Closed Bug 1093421 Opened 10 years ago Closed 9 years ago

new Intl.NumberFormat("en-US", { style: "currency", currency: "USD", currencyDisplay: "name" }).format(5) shouldn't throw

Categories

(Core :: JavaScript: Internationalization API, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla42
Tracking Status
firefox42 --- fixed

People

(Reporter: Waldo, Assigned: Waldo)

References

Details

Attachments

(1 file)

But it does right now for some reason.  The "symbol" display type works, but neither "name" nor "code" do.  I suspect it's a CLDR issue of some sort, given the exact same code path is used for all three cases.  Either that or we're misusing ICU somehow.  Investigation needed.
Turns out unum_open flat-out doesn't support UNUM_CURRENCY_PLURAL or UNUM_CURRENCY_ISO.  (Or at least not in the ICU we embed, haven't checked newer.)  Fun.  In searching to see how others use these enums, I also discovered Norbert stumbled across this awhile ago:

http://sourceforge.net/p/icu/mailman/message/30777490/
According to Norbert updating to ICU53 should resolve this issue (bug 866372, bug 992079, bug 1075758).
The upgrade to ICU 55 fixed this, just need to land a test.

I have not tryservered this to see what b2g with its potential system-icu makes of this.  Obviously that'll need to happen before landing.
Attachment #8628155 - Flags: review?(andrebargull)
Assignee: nobody → jwalden+bmo
Status: NEW → ASSIGNED
Comment on attachment 8628155 [details] [diff] [review]
Add a test for support for currencyDisplay: 'name' or 'code' when formatting numbers

Review of attachment 8628155 [details] [diff] [review]:
-----------------------------------------------------------------

The new test looks ok to me, but why was 'js/src/tests/Intl/NumberFormat/format.js' removed?
Attachment #8628155 - Flags: review?(andrebargull) → review+
(In reply to André Bargull from comment #4)
> The new test looks ok to me, but why was
> 'js/src/tests/Intl/NumberFormat/format.js' removed?

Clearly because I r dumb.  Reverted before landing.
https://hg.mozilla.org/mozilla-central/rev/dd057afbe61a
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla42
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: