Results 1 to 6 of 6

Thread: Formatting Numbers

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jan 1999
    Location
    UK
    Posts
    554
    Hi,

    I want to show numeric values in a table cell, and I need to round it off to 2 decimal places.

    I cannot use
    Code:
    = Format$(TheNumber,"00.00")
    because vbscript doesn't support it.
    Any ideas anyone?

    DocZaf
    {;->

  2. #2
    Guest
    VBScript supports the Round function.


    Code:
    ?Round(TheNumber, 2)

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Jan 1999
    Location
    UK
    Posts
    554
    Thanks Matthew and how about padding with zero's?


    Zaf
    {;->

  4. #4
    Guest
    What do you mean?

  5. #5
    New Member
    Join Date
    Feb 2001
    Posts
    12
    lo there,

    maybe I can help, you cant use the format function but you can use FormatNumber
    ie for what you want try:

    FormatNumber(TheNumber, 2)

    then you shouldn't need to worry about the padding with 0's.

    hope that helps

  6. #6

    Thread Starter
    Fanatic Member
    Join Date
    Jan 1999
    Location
    UK
    Posts
    554
    Thanks Jeh, that should do it,

    thanks everyone.


    DocZaf
    {;->

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