Results 1 to 2 of 2

Thread: Formatting a variable

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jan 2002
    Posts
    69

    Formatting a variable

    Hi,

    I'm calculating a number that I want it to have 2 decimal ex: 147.65 or 25.00

    In c++ I would do a .format on my variable but how can I do that in javascript ?

    thanks

  2. #2

    Thread Starter
    Lively Member
    Join Date
    Jan 2002
    Posts
    69
    I found it, here is the solution

    myvar.toFixed(numberofdecimaldigit);

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width