Skip to content

Commit 34d9129

Browse files
srl295rvagg
authored andcommitted
deps: icu: apply workaround patch
ICU 62.1 had a bug where certain orders of operations would not work with the minimum significant digit setting. Fixed in ICU 63.1. Applied the following patch from v8. https://chromium-review.googlesource.com/c/chromium/deps/icu/+/1128503 ICU Bug: https://unicode-org.atlassian.net/browse/ICU-20063 Fixes: #22156 PR-URL: #23764 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Refael Ackermann <[email protected]>
1 parent f037942 commit 34d9129

File tree

2 files changed

+1396
-2
lines changed

2 files changed

+1396
-2
lines changed

test/parallel/test-intl.js

+12-2
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,18 @@ if (!common.hasIntl) {
101101
assert.strictEqual(localeString, '1/1/1970, 12:00:00 AM');
102102
}
103103
// number format
104-
const numberFormat = new Intl.NumberFormat(['en']).format(12345.67890);
105-
assert.strictEqual(numberFormat, '12,345.679');
104+
{
105+
const numberFormat = new Intl.NumberFormat(['en']).format(12345.67890);
106+
assert.strictEqual(numberFormat, '12,345.679');
107+
}
108+
// Significant Digits
109+
{
110+
const loc = ['en-US'];
111+
const opts = { maximumSignificantDigits: 4 };
112+
const num = 10.001;
113+
const numberFormat = new Intl.NumberFormat(loc, opts).format(num);
114+
assert.strictEqual(numberFormat, '10');
115+
}
106116

107117
const collOpts = { sensitivity: 'base', ignorePunctuation: true };
108118
const coll = new Intl.Collator(['en'], collOpts);

0 commit comments

Comments
 (0)