Print Page | Close Window

rounding numbers

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=11949
Printed Date: 30 March 2026 at 11:40pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: rounding numbers
Posted By: asp what that??
Subject: rounding numbers
Date Posted: 26 September 2004 at 1:51am

hey all i am having a problem rounding numbers...

i tried this

Quote val1 = roundit(val1)
val2 = roundit(val2)
..
Function roundit(numToRound)
roundit = Round(numToRound)
End Function

but the problem with this is that it rounds to then nearest whole number....what i am in need of is if a number is past the whole number round it to the next highest number

Quote

example:

intsomething = intsomenumber / intsomeothernumber

which turns out in my situation

intsomething = 100 / 14

and intsomething = 7.1428571428571428571428571428571

i need to take and make 7.1428571428571428571428571428571 go up to the next highest whole number

any help on this would be great!!!

 

 




Replies:
Posted By: ljamal
Date Posted: 26 September 2004 at 9:08am

Function RoundUp (numValue)
RoundUp = Fix(numValue)
if RoundUp < numValue then RoundUp = RoundUp + 1 end if
End Function


-------------
L. Jamal Walton

http://www.ljamal.com/" rel="nofollow - L. Jamal Inc : Web/ Print Design and ASP Programming


Posted By: asp what that??
Date Posted: 26 September 2004 at 11:20am
hey thanks for the super fast reply...you guys rule!!



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net