J
Joe Delphi
Greetings,
I have a requirement to divide two numbers and then round the result down to
the next whole number. In other words, if the result comes out to be 12.91,
the user wants to see 12.00. I know that rounding usually occurs at the .5
mark, but this is the way the user wants it so this is how it has to be.
I am attempting to do it like this:
..Fields("RawResult") = Fix(.Fields("Actual") / .Fields("Target") * 100) /
100
It works with some combinations of numbers, but not with others. For
example, when I enter 114 for Actual and 100 for target (114/100) I should
get a result of 1.14 but instead I get a result of 1.13. The fields are
all defined as numeric doubles.
Anyone know how to get it to round down to the next whole number without
giving what appears to be the wrong answer?
JD
I have a requirement to divide two numbers and then round the result down to
the next whole number. In other words, if the result comes out to be 12.91,
the user wants to see 12.00. I know that rounding usually occurs at the .5
mark, but this is the way the user wants it so this is how it has to be.
I am attempting to do it like this:
..Fields("RawResult") = Fix(.Fields("Actual") / .Fields("Target") * 100) /
100
It works with some combinations of numbers, but not with others. For
example, when I enter 114 for Actual and 100 for target (114/100) I should
get a result of 1.14 but instead I get a result of 1.13. The fields are
all defined as numeric doubles.
Anyone know how to get it to round down to the next whole number without
giving what appears to be the wrong answer?
JD