#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2001
    Posts
    130
    Rep Power
    14

    formatting numbers in Javascript?


    Hi all,.

    I have a script which is dynamically recalculating values in a table. I'd like to format the output to two decimal places, even if they are zeros. Is there an easy way to do this in Javascript?
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2000
    Posts
    179
    Rep Power
    15
    I downloaded a number format script (Number Format v1.0)generously created by someone else at:

    http://www.mredkj.com/javascript/index.html

    You could spin your own script if you'd like. I don't know of a built in Javascript function to handle what you are asking for.

    Hope that helps,
    Paul

IMN logo majestic logo threadwatch logo seochat tools logo