1// Javascript has a number formatter (part of the Internationalization API).
2
3const number = 123456.789;
4
5// another example
6console.log(new Intl.NumberFormat('ja-JP', {
7 style: 'currency',
8 currency: 'BWP',
9}).format(number));
10
11// MORE INFO -> https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat
12
13
1function floatToEuro(float){
2 var euroCurrency
3 euroCurrency = '\u20AC' + float.toLocaleString('nl-NL',{minimumFractionDigits: 2});
4 console.log(euroCurrency);
5 return euroCurrency;
6};