mirror of
https://github.com/zebrajr/node.git
synced 2025-12-06 12:20:27 +01:00
test: add NumberFormat resolvedOptions test
Add a regression test for NumberFormat resolvedOptions. PR-URL: https://github.com/nodejs/node/pull/39401 Refs: https://github.com/nodejs/node/issues/39050 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Backport-PR-URL: https://github.com/nodejs/node/pull/39051
This commit is contained in:
parent
9b69069f71
commit
45c2ea3b72
|
|
@ -104,6 +104,13 @@ if (!common.hasIntl) {
|
|||
const numberFormat = new Intl.NumberFormat(['en']).format(12345.67890);
|
||||
assert.strictEqual(numberFormat, '12,345.679');
|
||||
}
|
||||
// Number format resolved options
|
||||
{
|
||||
const numberFormat = new Intl.NumberFormat('en-US', { style: 'percent' });
|
||||
const resolvedOptions = numberFormat.resolvedOptions();
|
||||
assert.strictEqual(resolvedOptions.locale, 'en-US');
|
||||
assert.strictEqual(resolvedOptions.style, 'percent');
|
||||
}
|
||||
// Significant Digits
|
||||
{
|
||||
const loc = ['en-US'];
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user