Forums

ASP

This topic is locked

Round Number

Posted 21 Apr 2003 16:30:37
1
has voted
21 Apr 2003 16:30:37 Talal Nabil posted:
Hello,

Do you guys know how to round any number with decimals to Integer

I have a calculation for number of boxes, I want to use the greatest number out of the calculation
I mean if the result is 2.12, means 3 boxes to use and if it 2.9 its also 3 boxes

Any Ideas

Replies

Replied 21 Apr 2003 22:09:16
21 Apr 2003 22:09:16 Brent Colflesh replied:
What you are describing is not actualling rounding the number - just check your string for an occurance of a period, get the numbers to the left of it and add 1.

Regards,
Brent

Replied 22 Apr 2003 03:31:07
22 Apr 2003 03:31:07 Talal Nabil replied:
Well, Thank you Brent for your response but I'm not that good in strings and arrays, will you please give me more details about this

Thanks again
<img src=../images/dmxzone/forum/icon_smile_big.gif border=0 align=middle>
Replied 24 Apr 2003 14:42:55
24 Apr 2003 14:42:55 Ruskin Spiers replied:
use

round([value to round],[number of decimal places])

so to round 1.52 you would have

round(1.52,0)

gives you 2. You can of course use variables instead of absolutes so should work for you.

Reply to this topic