patrandrews
Programmer
I am currently trying to use the RoundUp function in Crystal Report XI R2. 99% of the time it works fine but on occasion it is improperly rounding the value. The report as it is takes a string value, converts to a number, does some math, and then uses RoundUp.
If I put just the numbers in the formula it works fine:
RoundUp((.20 * 1.10), 2)
delivering the expected 0.22
But when using the field from the database:
RoundUp((.20 * val({Table.Field})), 2)
it comes back with 0.23.
The weird thing is that taking out RoundUp the value is .22. However when you expand the size of the field to 4 decimal places and put the Roundup back but to 3 places you get .221 which would explain the .23 if it wasn't coming up with the extra 0.001 from out of nowhere.
Any one come across this behavior before and know of a way to fix it. I could write a function and just bypass using RoundUp but I have apparently become fixated on figuring out why this is happening.
Thanks in advance
Patrick
If I put just the numbers in the formula it works fine:
RoundUp((.20 * 1.10), 2)
delivering the expected 0.22
But when using the field from the database:
RoundUp((.20 * val({Table.Field})), 2)
it comes back with 0.23.
The weird thing is that taking out RoundUp the value is .22. However when you expand the size of the field to 4 decimal places and put the Roundup back but to 3 places you get .221 which would explain the .23 if it wasn't coming up with the extra 0.001 from out of nowhere.
Any one come across this behavior before and know of a way to fix it. I could write a function and just bypass using RoundUp but I have apparently become fixated on figuring out why this is happening.
Thanks in advance
Patrick