Rounding Problem

  • Thread starter Thread starter stetat
  • Start date Start date
S

stetat

I am having problems with the results of calculations i am
doing. I am trying to round the result down to the nearest
single number using the below formula which works fine
with positive numbers, but with negative numbers it round
up (eg -1.923 to -2)

intNewValue = Int(Value1/Value2)

Can anyone help

Thank You
 
Mathematically, rounding -1.923 to -2 is rounding *down* since -2 is less
than -1.923.

It sounds like you want to use the Fix() function rather than the Int()
function.

?Fix(1.923)
1
(same as Int() for positive numbers)

?Fix(-1.923)
-1
(different from Int() for negative numbers)
 
Back
Top