Following this example I've tried to get large numbers formatted more compact:
console.log(
new Intl.NumberFormat(
'en-GB',
{ notation: "compact" , compactDisplay: "short" }
).format(987654321)
);
But my result, in both Firefox and Chrome, differs. I get "987,654,321" instead of the expected "988M" as in the example. Anyone know why this is the case and how I might be able to fix it?
I faced the same issue and I tried to look for a logical reason and I found this official documentation : https://v8.dev/features/intl-numberformat#notation And as I understood 'compact' option it's still not fully supported
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With