Open this example in the interactive library
Source code
console.log(
new Intl.NumberFormat("en-US", { notation: "compact" }).format(1250000),
);
Sample output
1.3M

Open this example in the interactive library
console.log(
new Intl.NumberFormat("en-US", { notation: "compact" }).format(1250000),
);
1.3M