views:

3609

answers:

2

Is there a simple way to format numbers in javascript, similar to the formatting available in C# (or VB.NET) via ToString("format_provider") or String.Format()?

+3  A: 

Formatting numbers in JavaScript

Formatting numbers for currency display and more.

In jQuery

http://code.google.com/p/jquery-numberformatter/

rahul
A word of warning: The jQuery number formatter you link to (I tried with v1.1.0) is completely broken and useless. As in: It does not work *at all*. Here is a decent formatting plugin: http://www.asual.com/jquery/format/
Tomalak
+1  A: 

You should probably have a look at the jQuery NUMBERFORMATTER plugin:

http://plugins.jquery.com/project/numberformatter

And this question:

http://stackoverflow.com/questions/726144/javascript-easier-way-to-format-numbers/

karim79