Dollar/Number formatting

Results 1 to 2 of 2

Thread: Dollar/Number formatting

  1. #1
    Kimberly Guest

    Default Dollar/Number formatting

    Hey guys, I have a running total SubTotal that I would like to display at the end of the page. If SubTotal=18.01 then that is what it displays, but if SubTotal=18.00, it only displays 18<BR>How can I get it to always display 2 decimal places? I tried format(SubTotal,2) {I had seen that somewhere?!?} but it didnt work...any suggestions?

  2. #2
    jason Guest

    Default RE: Dollar/Number formatting

    you need to find the position of the &#039.&#039 whit indexOf, then use that to shorten the number (as a string) with substring()<BR><BR>jason

Posting Permissions

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