Skip to content

Commit

Permalink
fix: handle empty options without undef
Browse files Browse the repository at this point in the history
  • Loading branch information
firebomb1 committed Feb 23, 2023
1 parent 0126642 commit ed0caf2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/hooks/useLocaleFormatter/useLocaleFormatter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ export const useLocaleFormatter = (args?: useLocaleFormatterArgs): NumberFormatt
// Filter out undefined options caused by optional component props so they do not override the defaults
const filteredOptions = options
? Object.fromEntries(Object.entries(options).filter(([_, value]) => value !== undefined))
: undefined
: {}
const formatter = new Intl.NumberFormat(deviceLocale, {
notation: number < bounds.min || noDecimals ? 'standard' : 'compact',
compactDisplay: fiatType || number < longCompactDisplayLowerBound ? 'short' : 'long',
Expand Down

0 comments on commit ed0caf2

Please sign in to comment.