Debian Codegraph @

js/src/tests/test262/intl402/NumberFormat/dft-currency-mnfd-range-check-mxfd.js

raw
1 // Copyright 2017 the V8 project authors. All rights reserved.
2 // Copyright 2020 Apple Inc. All rights reserved.
3 // This code is governed by the license found in the LICENSE file.
4
5 /*---
6 esid: sec-setnfdigitoptions
7 description: >
8 When a currency is used in Intl.NumberFormat and minimumFractionDigits is
9 not provided, maximumFractionDigits should be set as provided.
10 ---*/
11
12 assert.sameValue((new Intl.NumberFormat('en', {
13 style: 'currency',
14 currency: 'USD',
15 maximumFractionDigits: 1
16 })).resolvedOptions().maximumFractionDigits, 1);
17
18 assert.sameValue((new Intl.NumberFormat('en', {
19 style: 'currency',
20 currency: 'CLF',
21 maximumFractionDigits: 3
22 })).resolvedOptions().maximumFractionDigits, 3);
23
24 reportCompare(0, 0);