I format a float to a locale string (Euro) and there are very different results in every browser. Is it possible to fix without an 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 €
IE result: 2.282,00 €
Safari result: 2282 €
Safari results are very much wrong, chrome results are not so much bad. Any Idea how to fix that without writing an own function for formatting?
This question may already have an answer here: Inconsistent behavior of toLocaleString() in different browser No, my question is different because i am searching for a solution for Currency, not DATE
See Question&Answers more detail:os