Bug 246646 - [JSC] Intl.NumberFormat ignores maximumFractionDigits with compact notation (both currency and decimal)
Summary: [JSC] Intl.NumberFormat ignores maximumFractionDigits with compact notation (...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: Safari 16
Hardware: Mac (Intel) macOS 12
: P2 Normal
Assignee: Yusuke Suzuki
URL:
Keywords: BrowserCompat, InRadar
: 249231 (view as bug list)
Depends on:
Blocks:
 
Reported: 2022-10-17 13:08 PDT by Max Starets
Modified: 2022-12-18 23:41 PST (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 Max Starets 2022-10-17 13:08:18 PDT
To reproduce, try the following:
new Intl.NumberFormat('en-US', {style: 'currency', currency: 'USD', notation: 'compact', maximumFractionDigits: 2, compactDisplay: 'long'}).format(97896)
Safari output: "$98K"
Firefox and Chrome output: "$97.90K"

new Intl.NumberFormat('en-US', {style: 'decimal', notation: 'compact', maximumFractionDigits: 2, compactDisplay: 'long'}).format(97896)
Safari output: "98 thousand" 
Firefox and Chrome output: "97.9 thousand"
Comment 1 Karl Dubost 2022-10-17 22:28:10 PDT
There is also no tests on WPT covering this: Intl.NumberFormat
https://wpt.fyi/results/?label=master&label=experimental&aligned&view=subtest&q=maximumfractiondigits
Comment 2 Yusuke Suzuki 2022-10-18 10:10:48 PDT
(In reply to Karl Dubost from comment #1)
> There is also no tests on WPT covering this: Intl.NumberFormat
> https://wpt.fyi/results/
> ?label=master&label=experimental&aligned&view=subtest&q=maximumfractiondigits

Intl.NumberFormat is not web API. It is test262's job to cover that.
Comment 3 Yusuke Suzuki 2022-10-18 10:24:23 PDT
We should apply the spec side change.
Comment 4 Radar WebKit Bug Importer 2022-10-18 10:28:31 PDT
<rdar://problem/101298045>
Comment 5 Yusuke Suzuki 2022-10-18 10:34:40 PDT
Pull request: https://github.com/WebKit/WebKit/pull/5501
Comment 6 EWS 2022-10-18 12:32:00 PDT
Committed 255691@main (9c113c3fb2ab): <https://commits.webkit.org/255691@main>

Reviewed commits have been landed. Closing PR #5501 and removing active labels.
Comment 7 Yusuke Suzuki 2022-12-18 23:41:30 PST
*** Bug 249231 has been marked as a duplicate of this bug. ***