2017-03-06 15:19:40 +01:00
|
|
|
// Copyright 2017 the V8 project authors. All rights reserved.
|
2020-09-26 05:26:40 +02:00
|
|
|
// Copyright 2020 Apple Inc. All rights reserved.
|
2017-03-06 15:19:40 +01:00
|
|
|
// This code is governed by the license found in the LICENSE file.
|
|
|
|
|
|
|
|
/*---
|
|
|
|
esid: sec-setnfdigitoptions
|
|
|
|
description: >
|
|
|
|
When a currency is used in Intl.NumberFormat and minimumFractionDigits is
|
2020-09-23 20:58:54 +02:00
|
|
|
not provided, maximumFractionDigits should be set as provided.
|
2017-03-06 15:19:40 +01:00
|
|
|
---*/
|
|
|
|
|
2020-08-13 19:31:24 +02:00
|
|
|
assert.sameValue((new Intl.NumberFormat('en', {
|
2017-03-06 15:19:40 +01:00
|
|
|
style: 'currency',
|
2020-09-15 10:26:02 +02:00
|
|
|
currency: 'USD',
|
2020-09-23 20:58:54 +02:00
|
|
|
maximumFractionDigits: 1
|
|
|
|
})).resolvedOptions().maximumFractionDigits, 1);
|
2020-09-15 10:26:02 +02:00
|
|
|
|
|
|
|
assert.sameValue((new Intl.NumberFormat('en', {
|
|
|
|
style: 'currency',
|
|
|
|
currency: 'CLF',
|
2020-09-23 20:58:54 +02:00
|
|
|
maximumFractionDigits: 3
|
2020-09-26 05:26:40 +02:00
|
|
|
})).resolvedOptions().maximumFractionDigits, 3);
|