Skip to content

Commit

Permalink
Remove maximumSignificantDigits cap by default on the formatKM util; …
Browse files Browse the repository at this point in the history
…it can be set as options if needed
  • Loading branch information
SARodrigues committed Jan 17, 2024
1 parent f9aff66 commit b3c6efa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,9 @@ const ProtectedAreaPopup = ({ locationId }: { locationId: number }) => {
{format({
value: DATA?.REP_M_AREA,
id: 'formatKM',
options: {
maximumSignificantDigits: 3,
},
})}
Km<sup>2</sup>
</dd>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/lib/utils/formats.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export function formatKM(value: number, options?: Intl.NumberFormatOptions) {
compactDisplay: 'short',
unit: 'kilometer',
unitDisplay: 'short',
maximumSignificantDigits: 3,
maximumFractionDigits: 0,
...options,
});

Expand Down

0 comments on commit b3c6efa

Please sign in to comment.