-
Well not quite, it is more like 92.6 rounded off = 92?????
When i did maths i learnt that any decimal that was 5 or over you round up, else you round down. Has Microsoft re-invented maths to its requirements and no one elses?
Please someone help with this, a screen shot of the code and what happens it at this site:
http://webxd.hypermart.net/MSCrap.gif
Please help, it should be simple.
-
You need to use Round() instead of Int(). Int *truncates* the number, so anything past the decimal point is removed. Round actually rounds the number. Sytax is:
Round(expression [,numdecimalplaces])
-
Or you can use the CInt function.
Code:
Debug.Print CInt(5.6) ' = 6
Debug.Print CInt(5.4) ' = 5
Debug.Print CInt(5.5) ' = 6
Debug.Print CInt(4.5) ' = 4 ( n.5 is always rounded to an even number