Skip to content

Commit ab58439

Browse files
srl295targos
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 c30de85 commit ab58439

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
@@ -99,8 +99,18 @@ if (!common.hasIntl) {
9999
assert.strictEqual(localeString, '1/1/1970, 12:00:00 AM');
100100
}
101101
// number format
102-
const numberFormat = new Intl.NumberFormat(['en']).format(12345.67890);
103-
assert.strictEqual(numberFormat, '12,345.679');
102+
{
103+
const numberFormat = new Intl.NumberFormat(['en']).format(12345.67890);
104+
assert.strictEqual(numberFormat, '12,345.679');
105+
}
106+
// Significant Digits
107+
{
108+
const loc = ['en-US'];
109+
const opts = { maximumSignificantDigits: 4 };
110+
const num = 10.001;
111+
const numberFormat = new Intl.NumberFormat(loc, opts).format(num);
112+
assert.strictEqual(numberFormat, '10');
113+
}
104114

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

0 commit comments

Comments
 (0)