I am using http://numeraljs.com/#format
I need formatter, which can covert number with apostrophe to comma.
Eg: 2'910'724'242 must change to 2,910,724,242
Is there any formatter available. Or we have to manually convert apostrophe to comma.
I am using http://numeraljs.com/#format
I need formatter, which can covert number with apostrophe to comma.
Eg: 2'910'724'242 must change to 2,910,724,242
Is there any formatter available. Or we have to manually convert apostrophe to comma.
Álvaro González
On
It may not be the best way (I'm not familiar with the library) but, since you can't seemingly set the format on parsing, you can change the default:
let input = "2'910'724'242.6666";
numeral.defaultFormat("0'0.00");
let number = numeral(input);
let output = number.format("0,0.00");
console.log("Input: %s; Output: %s", input, output);
<script src="https://cdnjs.cloudflare.com/ajax/libs/numeral.js/2.0.6/numeral.min.js"></script>
No need for a library
But if you insist