0

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?

2 Answers 2

1

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 toPrecision and toFixed which can be used for basic formatting.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks looks to be useful! Cheers! I'll spend some time investigating it.
1

There is no built in support for string formatting in JavaScript, but how about the sprintf port for JavaScript?

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.