C# has the very useful ability to format numeric values with a format string.
http://msdn.microsoft.com/en-us/library/0c899ak8.aspx
From what I have read it appears JavaScript has no such functionality. Is anyone aware of a library that will do something similar or is it a case of having to create your own code? Maybe I am mistaken and there is inbuilt support for this?
You can use a jQuery pluggin to achieve the similar functionality in javascript.
Also here you can find customized javascript functions which would help you for number formatting.
There are some javascript functions like
toPrecisionandtoFixedwhich can be used for basic formatting.