Closed
Bug 866372
Opened 12 years ago
Closed 9 years ago
Currency formatting with currencyDisplay="name" results in error
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
RESOLVED
DUPLICATE
of bug 1093421
People
(Reporter: mozillabugs, Unassigned)
References
Details
Intl.NumberFormat.prototype.format throws an error when asked to format a currency value with currencyDisplay="name":
js> print(new Intl.NumberFormat("en-US", {style: "currency", currency: "USD", currencyDisplay: "name"}).format(0))
typein:1:0 Error: internal error while computing Intl data
Reporter | ||
Comment 1•12 years ago
|
||
Calling unum_open with the style parameter set to UNUM_CURRENCY_ISO or UNUM_CURRENCY_PLURAL returns status U_UNSUPPORTED_ERROR.
In the API spec, both are listed as normal values of the parameter type UNumberFormatStyle, but then are not listed as possible values for unum_open. In the implementation, they are not supported in the big case statement in the implementation.
http://icu-project.org/apiref/icu4c/unum_8h.html#a4eb4d3ff13bd506e7078b2be4052266d
http://icu-project.org/apiref/icu4c/unum_8h.html#a581f9eb53d6b1b052b751272e1c6b67f
http://bugs.icu-project.org/trac/browser/icu/trunk/source/i18n/unum.cpp#L49
Sent inquiry to icu-support@lists.sourceforge.net.
Reporter | ||
Comment 2•12 years ago
|
||
Adding the two constants to the switch statement seems to fix the problem.
Filed ICU ticket:
http://bugs.icu-project.org/trac/ticket/10135
Reporter | ||
Comment 3•11 years ago
|
||
The ICU bug has been fixed for ICU 53, although under a different ticket:
http://bugs.icu-project.org/trac/ticket/10676
Change sets:
http://bugs.icu-project.org/trac/review/10676
Assignee | ||
Updated•10 years ago
|
Assignee: general → nobody
In latest Firefox (33.0.2), I get the error for currencyDisplay = "name" as well as "code" (!).
Why isn't it fixed? Does Firefox use an old ICU version?
Comment 5•10 years ago
|
||
Still same error as in the last comment in Firefox 37.0.1.
Updated•10 years ago
|
I am getting same error.
1222221.0.toLocaleString("NL-en", {style: 'currency', currency: 'EUR', currencyDisplay: 'code', minimumFractionDigits:2, maximumFractionDigits:2})
When i used this funtion in my angular filter, its giving meta data like {{model.modelValue | CustomCurrency:model.currencyData}} in the html. only happens in firfox.
Comment 7•9 years ago
|
||
If comment 6 still exists in a version of Firefox with this fixed -- that is, in Firefox 42 -- please file a new bug for it. But currencyDisplay: "name" does generally work now.
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → DUPLICATE
You need to log in
before you can comment on or make changes to this bug.
Description
•