Hi everybody
I am trying to assign the result of a calculation to be returned as an integer but the result puts loads of decimal places that I dont want can anyone tell me where I,m going wrong
Thanks
Printable View
Hi everybody
I am trying to assign the result of a calculation to be returned as an integer but the result puts loads of decimal places that I dont want can anyone tell me where I,m going wrong
Thanks
the function to use is Round:
i.e.
gives the result 3.Code:Msgbox Round(2.888)
Be careful if you use Int. It takes the integer position only, thus Int(2.888) returns 2
Hope this helps
Hi
Thanks for the reply.i've put the number as single but it still rounds down. could the problem be that i'm obtaining the value with a calculation using integers??
Thanks!
Try, CInt.
Code:MyValue = CInt(MyValue)