mirror of
https://github.com/nodejs/node.git
synced 2026-11-29 14:27:57 -05: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>
This commit is contained in:
1 parent
00cac65af1
commit
07e83f77fa
1 file changed
+7
@@ -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'];
|
||||
|
||||
Reference in new issue
Block a user