-
Rounding down
I have a var defined as double - I am using the round() function to set the resulting var to 1 dec place eg :
TempCalc = round( 0.15 , 1 )
Std VB setting is to round up to 0.2 - but is there a setting I can use to round down in this instance - ie the result I want is 0.1
If the value is 0.16 - then yes, I do want it to rounded up to 0.2
-
subtract 0.01 from your variable before rounding it
-
if it is 1.5 u should round up
-
You're not wrong - try telling my customer this !
thanks for both comments, I've found a formula on another forum that seems to work it out :
x = 0.015
X = Int(X * 100 + 0.5) / 100
returns 0.01
if x = 0.016 then returns 0.02 - sweet