I format the float to a locale string (Euro), and the results in each browser are very different. Can I fix it without my own function?
var sum=2282.0000; var formated_sum = Number(sum.toFixed(2)).toLocaleString("de-DE", {style: "currency", currency: "EUR"});
Firefox Result: € 2,282.00
Chrome result: 2.282 €
Result IE: 2.282,00 €
Safari result: 2282 €
Safari's results are very wrong, chrome results are not so bad. Any idea how to fix this without writing your own formatting function?
This question may already have the answer here: Inconsistent behavior of toLocaleString () in different browsers No, my question is different from what I am looking for a solution for Currency, not DATE
source share