Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error E_MISSING_CLDR with Globalize.currencyFormatter #948

Open
MdWaqas opened this issue Jun 20, 2024 · 0 comments
Open

Error E_MISSING_CLDR with Globalize.currencyFormatter #948

MdWaqas opened this issue Jun 20, 2024 · 0 comments

Comments

@MdWaqas
Copy link

MdWaqas commented Jun 20, 2024

Issue: Error E_MISSING_CLDR with Globalize.currencyFormatter

Description

The Globalize.currencyFormatter function is throwing an E_MISSING_CLDR error when using Globalize.formatCurrencyToParts with certain currencies like BGN (Bulgarian Lev). This issue arises because the new CLDR version does not include symbols for currencies that traditionally do not have symbols.

Error Details

When calling Globalize.formatCurrencyToParts(23.50, 'BGN');, the error message is:

Error: E_MISSING_CLDR: Missing required CLDR content `main/en-US/numbers/currencies/BGN/symbol`.

Background

Previous versions of CLDR provided a default symbol for every currency, regardless of whether it had a symbol in practice. For example, BGN previously had 'BGN' as its symbol in the CLDR, but this is no longer the case in the newer versions.

Questions

  • Are you facing this issue as well?
  • Is there any known workaround?
  • Can we pass a default symbol when calling the function to mitigate this issue?

Proposed Solution

Actually I am using this function in a function that is in used at 1000s of places so do not want to add the fix that can have bigger impact and can open testing

Globalize.js - Version 1.7.0
CLDR JavaScript Library v0.5.3 2020-08-05T21:43Z @rxaviers

Your insights and suggestions on this matter would be greatly appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant