currency-narrow-symbol.js (986B)
1 // |reftest| skip-if(!this.hasOwnProperty("Intl")) 2 3 const { 4 Integer, Decimal, Fraction, Currency, Literal, 5 } = NumberFormatParts; 6 7 const testcases = [ 8 { 9 locale: "en-CA", 10 options: { 11 style: "currency", 12 currency: "USD", 13 currencyDisplay: "narrowSymbol", 14 }, 15 values: [ 16 {value: 123, string: "$123.00", 17 parts: [Currency("$"), Integer("123"), Decimal("."), Fraction("00")]}, 18 ], 19 }, 20 21 // And for comparison "symbol" currency-display. 22 23 { 24 locale: "en-CA", 25 options: { 26 style: "currency", 27 currency: "USD", 28 currencyDisplay: "symbol", 29 }, 30 values: [ 31 {value: 123, string: "US$123.00", 32 parts: [Currency("US$"), Integer("123"), Decimal("."), Fraction("00")]}, 33 ], 34 }, 35 ]; 36 37 runNumberFormattingTestcases(testcases); 38 39 if (typeof reportCompare === "function") 40 reportCompare(true, true);