summaryrefslogtreecommitdiffstats
path: root/js/src/tests/non262/Intl/NumberFormat/currency-narrow-symbol.js
blob: bf2b9adcd8f625f6f593363411f663093ec70b3b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// |reftest| skip-if(!this.hasOwnProperty("Intl"))

const {
    Integer, Decimal, Fraction, Currency, Literal,
} = NumberFormatParts;

const testcases = [
    {
        locale: "en-CA",
        options: {
            style: "currency",
            currency: "USD",
            currencyDisplay: "narrowSymbol",
        },
        values: [
            {value: 123, string: "US$123.00",
             parts: [Currency("US$"), Integer("123"), Decimal("."), Fraction("00")]},
        ],
    },

    // And for comparison "symbol" currency-display.

    {
        locale: "en-CA",
        options: {
            style: "currency",
            currency: "USD",
            currencyDisplay: "symbol",
        },
        values: [
            {value: 123, string: "US$123.00",
             parts: [Currency("US$"), Integer("123"), Decimal("."), Fraction("00")]},
        ],
    },
];

runNumberFormattingTestcases(testcases);

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