I'm using the Number.prototype.toLocaleString()
function to add commas to whole numbers. Documentation for it can be found here.
I am writing it as follows:
Number(data).ToLocaleString('en');
In Firefox/Chrome the number is displayed like 123,456,789
. However, in IE it is displayed like 123,456,789.00
.
1. Why is IE adding in the decimal point values?
2. How can I remove the decimal point values?
Rather than creating/using a custom function, I'm really just wondering if there is an option that I can add to ToLocaleString() like en, nodecimal
. If that option is not available, I will consider a custom function.