Bug 226297
| Summary: | Safari's Intl.NumberFormat currencyDisplay doesn't support narrowSymbol | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Matt Gross <magross> |
| Component: | JavaScriptCore | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED DUPLICATE | ||
| Severity: | Normal | CC: | ap, fpizlo, mmaxfield, webkit-bug-importer, ysuzuki |
| Priority: | P2 | Keywords: | InRadar |
| Version: | Safari 14 | ||
| Hardware: | Mac (Intel) | ||
| OS: | macOS 11 | ||
Matt Gross
Hey team!
This issue has come up in a few places around the web, but I haven't seen a WebKit bug for it yet.
In other browsers, and per the Intl spec, `currencyDisplay` should accept the `narrowSymbol` option.
`Intl.NumberFormat('fr-CA', { style: 'currency', currency: 'CAD', currencyDisplay: 'narrowSymbol' }).format(12345);`
should return "12 345,00 $" but in Safari it throws the following error:
`RangeError: currencyDisplay must be either "code", "symbol", or "name"`
Spec on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#parameters
ECMA 2020 Spec: https://402.ecma-international.org/7.0/#sec-setnumberformatunitoptions
It would be great to get support for this!
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/78784118>
Yusuke Suzuki
This is implemented in Safari 14.1 on Big Sur / iOS 14.5 Safari.
*** This bug has been marked as a duplicate of bug 209774 ***
Matt Gross
TY!
I just updated to 14.1 & saw it start working :)