Bug 226297 - Safari's Intl.NumberFormat currencyDisplay doesn't support narrowSymbol
Summary: Safari's Intl.NumberFormat currencyDisplay doesn't support narrowSymbol
Status: RESOLVED DUPLICATE of bug 209774
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: Safari 14
Hardware: Mac (Intel) macOS 11
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-05-26 14:53 PDT by Matt Gross
Modified: 2021-06-03 11:09 PDT (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matt Gross 2021-05-26 14:53:37 PDT
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!
Comment 1 Radar WebKit Bug Importer 2021-06-02 14:54:19 PDT
<rdar://problem/78784118>
Comment 2 Yusuke Suzuki 2021-06-03 10:09:09 PDT
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 ***
Comment 3 Matt Gross 2021-06-03 11:09:06 PDT
TY!

I just updated to 14.1 & saw it start working :)