Skip to content
Permalink
Browse files

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 <jasnell@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
  • Loading branch information
srl295 authored and MylesBorins committed Aug 7, 2018
1 parent 070d87a commit 1bed1107c7a6657c1635889d62923e2a96995ac2
Showing with 1,396 additions and 2 deletions.
  1. +12 −2 test/parallel/test-intl.js
  2. +1,384 −0 tools/icu/patches/62/source/i18n/decimfmt.cpp
@@ -99,8 +99,18 @@ if (!common.hasIntl) {
assert.strictEqual(localeString, '1/1/1970, 12:00:00 AM');
}
// number format
const numberFormat = new Intl.NumberFormat(['en']).format(12345.67890);
assert.strictEqual(numberFormat, '12,345.679');
{
const numberFormat = new Intl.NumberFormat(['en']).format(12345.67890);
assert.strictEqual(numberFormat, '12,345.679');
}
// Significant Digits
{
const loc = ['en-US'];
const opts = { maximumSignificantDigits: 4 };
const num = 10.001;
const numberFormat = new Intl.NumberFormat(loc, opts).format(num);
assert.strictEqual(numberFormat, '10');
}

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

0 comments on commit 1bed110

Please sign in to comment.
You can’t perform that action at this time.