blob: 4bdf26b9adf58cda017963d9132d300eb0f675f1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
// |reftest| skip-if(!this.hasOwnProperty("Intl"))
let nf = new Intl.NumberFormat("en", {
minimumFractionDigits: 0,
maximumFractionDigits: 2,
notation: "compact",
});
assertEq(nf.format(1500), "1.5K");
assertEq(nf.format(1520), "1.52K");
assertEq(nf.format(1540), "1.54K");
assertEq(nf.format(1550), "1.55K");
assertEq(nf.format(1560), "1.56K");
assertEq(nf.format(1580), "1.58K");
if (typeof reportCompare === "function")
reportCompare(true, true);
|