Closed PeterDeKok closed 3 years ago
Globalize('en_GB').formatCurrency(1234, 'EUR')
TypeError: Cannot read property 'test' of undefined at node_modules/globalize/dist/globalize/currency.js:236:35
Probably as a result of this issue: Unicode JIRA - CLDR #13838 Which has been implemented (as it seems) from CLDR v38.0.0
(At least the) en-GB numbers data of the CLDR data now contains a more complex regex pattern:
// cldr-numbers-modern: // main/en-GB/numbers/currencyFormats-numberSystem-latn/currencySpacing/beforeCurrency/currencyMatch // main/en-GB/numbers/currencyFormats-numberSystem-latn/currencySpacing/afterCurrency/currencyMatch "[[:^S:]&[:^Z:]]"
Relevant code for convenience:
// globalize/dist/globalize/currency.js:180 var regexp = { "[:digit:]": /\d/, "[:^S:]": regexpNotS };
// globalize/dist/globalize/currency.js:229 var currencyMatch = regexp[ currencySpacing[ i ].currencyMatch ];
// globalize/dist/globalize/currency.js:236 currencyMatch = currencyMatch.test( symbol.charAt( i ? symbol.length - 1 : 0 ) );
en_US is having the same error.
Thanks for the info. Will accept PR. Anyone willing to contribute the fix? Thanks in advance.
Fixed in 1.7.0
Probably as a result of this issue: Unicode JIRA - CLDR #13838 Which has been implemented (as it seems) from CLDR v38.0.0
(At least the) en-GB numbers data of the CLDR data now contains a more complex regex pattern:
Relevant code for convenience: