Format currency using javascript -


a script returns either number 0.0580 in x.xxxx format or (x) x units left.

i want format number 0.0580 , return 5.8 cent or return x units left.

any ideas how in javascript? how format x.xxxx?

in case first x not 0 want return e.g. 1.75$.

ms has written nice plugin jquery. it's useful if you're localizing. give go:

http://weblogs.asp.net/scottgu/archive/2010/06/10/jquery-globalization-plugin-from-microsoft.aspx

i'm not sure if can used outside of jquery...


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -