G Guest Aug 7, 2006 #1 Is there a standard a VB function that rounds up a long to it's nearest integer (and always rounds up)?
Is there a standard a VB function that rounds up a long to it's nearest integer (and always rounds up)?
O OfficeDev18 via AccessMonster.com Aug 7, 2006 #2 Why not use the old standby, adding .5 to your original number, as in: Round(SomeDecimalNumber + .5000, 4), which, if SomeDecimalNumber = 4.5000, will result in 5. As I remember, it always rounds up. Sam
Why not use the old standby, adding .5 to your original number, as in: Round(SomeDecimalNumber + .5000, 4), which, if SomeDecimalNumber = 4.5000, will result in 5. As I remember, it always rounds up. Sam
J John Spencer Aug 7, 2006 #3 Since a LONG number is an integer, I can only guess you want to round a number of type double up to the next integer. There is no built in function to round up to the nearest integer. You should be able to use -Int(YourNumber * -1) Note this rounds to the next higher integer, so negative numbers will round towards zero. -3.1 will return -3 (not -4)
Since a LONG number is an integer, I can only guess you want to round a number of type double up to the next integer. There is no built in function to round up to the nearest integer. You should be able to use -Int(YourNumber * -1) Note this rounds to the next higher integer, so negative numbers will round towards zero. -3.1 will return -3 (not -4)
T Tim Ferguson Aug 7, 2006 #4 There is no built in function to round up to the nearest integer. You should be able to use Click to expand... RoundUp = IIf(Int(AValue)=AValue, _ AValue, Int(AValue)+1 ) .... as long as AValue is a valid Double or Single value. Tim F
There is no built in function to round up to the nearest integer. You should be able to use Click to expand... RoundUp = IIf(Int(AValue)=AValue, _ AValue, Int(AValue)+1 ) .... as long as AValue is a valid Double or Single value. Tim F