Wie formatiere ich Zahlen mit JavaScript?

Will ich formatieren von zahlen mit JavaScript.

Beispiel:

10     => 10.00
100    => 100.00
1000   => 1,000.00
10000  => 10,000.00
100000 => 100,000.00
Kommentar zu dem Problem
Sind Sie sicher, dass Sie meine "1,00,000"? Vielleicht "100,000". Kommentarautor: Lightness Races in Orbit
@LightnessRacesinOrbit, Spaß Tatsache - in Indien, Sie in der Gruppe zahlen wie z.B. 12,34,567.89 Kommentarautor: Nils
@Nils Das ist nicht lustig 🙁 Kommentarautor: Lightness Races in Orbit
@Nils @BoundaryImposition: (1234567.89).toLocaleString('hi') "12,34,567.89" Kommentarautor: Michael

InformationsquelleAutor der Frage Kanak Vaghela | 2011-04-20

Schreibe einen Kommentar