Hi there,
I need codes on how to round up or down a numeric value.
eg. 223.56 ==> 223 (round down)
223.56 ==> 224 (round up)
really need it for a project.
wil lreally appreciate your help.
thanks.
eddy
[email protected]
Printable View
Hi there,
I need codes on how to round up or down a numeric value.
eg. 223.56 ==> 223 (round down)
223.56 ==> 224 (round up)
really need it for a project.
wil lreally appreciate your help.
thanks.
eddy
[email protected]
Hello Eddy,
Here's what I found.
Int - always rounds down.
CInt and CLng - round to the nearest integer (for ex., 1.51 they will round up while 1.49 they will round down).
I guess you'll have to write something of your own (but probably something very small) if you need to always round up.
Good luck.
Maria.
Simple, if CInt always rounds up with 1.50 and down with 1.49
and you want it to always round up, just add 0.5 to your value before using CInt
and if you want to always round down, just subtract 0.5 before using CInt.