summaryrefslogtreecommitdiffstats
path: root/js/src/tests/non262/Intl/NumberFormat/negativeZeroFractionDigits.js
blob: 0db461f50eae63d62f0da7eef49aed3185ef9889 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// |reftest| skip-if(!this.hasOwnProperty("Intl"))

const optionsList = [
    {minimumFractionDigits: -0, maximumFractionDigits: -0},
    {minimumFractionDigits: -0, maximumFractionDigits: +0},
    {minimumFractionDigits: +0, maximumFractionDigits: -0},
    {minimumFractionDigits: +0, maximumFractionDigits: +0},
];

for (let options of optionsList) {
    let numberFormat = new Intl.NumberFormat("en-US", options);

    let {minimumFractionDigits, maximumFractionDigits} = numberFormat.resolvedOptions();
    assertEq(minimumFractionDigits, +0);
    assertEq(maximumFractionDigits, +0);

    assertEq(numberFormat.format(123), "123");
}

if (typeof reportCompare === "function")
    reportCompare(true, true);