PDA

Click to See Complete Forum and Search --> : Formatting Numbers


Zaf Khan
Feb 9th, 2001, 09:52 PM
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

= Format$(TheNumber,"00.00")


because vbscript doesn't support it.
Any ideas anyone?

DocZaf
{;->

Feb 9th, 2001, 10:08 PM
VBScript supports the Round function.


?Round(TheNumber, 2)

Zaf Khan
Feb 9th, 2001, 10:33 PM
Thanks Matthew and how about padding with zero's?


Zaf
{;->

Feb 9th, 2001, 11:27 PM
What do you mean?

Jeh
Feb 10th, 2001, 07:26 AM
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:)

Zaf Khan
Feb 10th, 2001, 08:06 AM
Thanks Jeh, that should do it,

thanks everyone.


DocZaf
{;->