May 16, 2001 #1 aojonesoa Technical User Joined Apr 25, 2001 Messages 40 Location US I'm trying to fix a number to 2 decimal places even if the calculated value ends in zero. How do you do that in VBScript? Thx
I'm trying to fix a number to 2 decimal places even if the calculated value ends in zero. How do you do that in VBScript? Thx
May 16, 2001 #2 link9 Programmer Joined Nov 28, 2000 Messages 3,387 Location US rnd(number, 2) Where 'number' is the variable, and 2 is the number of places to format to -- and this is the best quick ref out there: http://www.devguru.com/Technologies/vbscript/quickref/vbscript_intro.html will save you mucho time. Paul Prewett Upvote 0 Downvote
rnd(number, 2) Where 'number' is the variable, and 2 is the number of places to format to -- and this is the best quick ref out there: http://www.devguru.com/Technologies/vbscript/quickref/vbscript_intro.html will save you mucho time. Paul Prewett
May 17, 2001 1 #3 Mighty Programmer Joined Feb 22, 2001 Messages 1,682 Location US You could also use: formatnumber(number,2) where number is your variable and 2 is the number of decimal places. Mise Le Meas, Mighty Upvote 0 Downvote
You could also use: formatnumber(number,2) where number is your variable and 2 is the number of decimal places. Mise Le Meas, Mighty