wip
This commit is contained in:
commit
d8f2407ddf
44 changed files with 10377 additions and 0 deletions
9
src/lib/format.ts
Normal file
9
src/lib/format.ts
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
export const mm = (value: number) =>
|
||||
Number.isFinite(value)
|
||||
? new Intl.NumberFormat('en-GB', { maximumFractionDigits: 1 }).format(value)
|
||||
: '—';
|
||||
export const area = (value: number) =>
|
||||
new Intl.NumberFormat('en-GB', { minimumFractionDigits: 2, maximumFractionDigits: 2 }).format(
|
||||
value / 1e6,
|
||||
);
|
||||
export const degree = (value: number) => `${mm(Math.abs(value))}°`;
|
||||
Loading…
Reference in a new issue