Skip to content

Commit

Permalink
Adapt our code for Nexus changes
Browse files Browse the repository at this point in the history
Adapt to account stats having optional fiels
  • Loading branch information
csillag committed May 29, 2024
1 parent 3bc40a6 commit 375c85e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/locales/getPreciseNumberFormat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ const isPreciseIntlSupported =
// Firefox 115 and Safari 16.5 return '111,222,333,444,555,670,000,000,000'
.at(-1) === '6'

export function getPreciseNumberFormat(value: string) {
export function getPreciseNumberFormat(value: string | undefined) {
if (value === undefined) return { value: 'NaN' }
const decimalPlaces = new BigNumber(value).decimalPlaces()
const isFloatPrecise = new BigNumber(value).isEqualTo(parseFloat(value))
// Fallback if types are not strict enough to prevent value=undefined and ''
Expand Down

0 comments on commit 375c85e

Please sign in to comment.