A
Altman
I am having a rounding problem all over the place and am struggling to
fix it. My problem is that I have an unit price and a quantity. When
I multiply them together they come out to 3.705. I want to round this
to 2 decimals. It always rounds to 3.70 though. Even when I put
math.round(3.705,2) in the debug watch, I get 3.70. How can I get this
to round correctly? I know one option would probably be to add .00001
to the value before rounding, as I am sure this is floating point
issue, but that might cause a problem in the future with other data.
fix it. My problem is that I have an unit price and a quantity. When
I multiply them together they come out to 3.705. I want to round this
to 2 decimals. It always rounds to 3.70 though. Even when I put
math.round(3.705,2) in the debug watch, I get 3.70. How can I get this
to round correctly? I know one option would probably be to add .00001
to the value before rounding, as I am sure this is floating point
issue, but that might cause a problem in the future with other data.