This repository was archived by the owner on Feb 23, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,8 @@ export const formatNumber = val => {
1414 if ( isNaN ( num ) ) {
1515 num = 0 ;
1616 }
17- return num . toLocaleString ( undefined , { maximumFractionDigits : 8 } ) ;
17+ const options = { maximumFractionDigits : 8 } ;
18+ return new Intl . NumberFormat ( undefined , options ) . format ( num ) ;
1819} ;
1920
2021/**
@@ -28,7 +29,8 @@ export const formatFiat = (val, currency) => {
2829 if ( isNaN ( num ) ) {
2930 num = 0 ;
3031 }
31- return num . toLocaleString ( undefined , { style : 'currency' , currency } ) ;
32+ const options = { style : 'currency' , currency } ;
33+ return new Intl . NumberFormat ( undefined , options ) . format ( num ) ;
3234} ;
3335
3436/**
@@ -83,10 +85,8 @@ export const toAmount = (satoshis, settings) => {
8385 const num = settings . displayFiat
8486 ? calculateExchangeRate ( satoshis , settings )
8587 : satoshis / UNITS [ settings . unit ] . denominator ;
86- return num . toLocaleString ( 'en-US' , {
87- useGrouping : false ,
88- maximumFractionDigits : 8 ,
89- } ) ;
88+ const options = { useGrouping : false , maximumFractionDigits : 8 } ;
89+ return new Intl . NumberFormat ( 'en-US' , options ) . format ( num ) ;
9090} ;
9191
9292/**
You can’t perform that action at this time.
0 commit comments