File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,12 @@ const DEFAULT_CURRENCY_FRACTIONS = 2;
1515const SYMBOL = "symbol" ;
1616const INVALID_CURRENCY_CODE = 'XXX' ;
1717
18+ const GLOBAL_CURRENCIES = {
19+ '001' : 'USD' , // 001 refers to world. not sure if it is correct to assume USD but seems better than throw an error
20+ '150' : 'EUR' // 150 territory for Europe
21+
22+ } ;
23+
1824function getCurrencyInfo ( locale , currency ) {
1925 const info = getLocaleInfo ( locale ) ;
2026 const currencies = info . numbers . currencies ;
@@ -121,6 +127,10 @@ export function currencyFractionOptions(code) {
121127}
122128
123129export function territoryCurrencyCode ( territory ) {
130+ if ( GLOBAL_CURRENCIES [ territory ] ) {
131+ return GLOBAL_CURRENCIES [ territory ] ;
132+ }
133+
124134 const currencyData = cldr . supplemental . currencyData ;
125135 if ( ! currencyData ) {
126136 throw NoSupplementalCurrency . error ( ) ;
You can’t perform that action at this time.
0 commit comments