I'm having trouble figuring out why my formula is not rounding as intended.
I am trying to round the cost rate to 2 places; then multiply the rounded cost rate times the hours.
Seems pretty simple, but I keep ending up one penny off.
This is crazy, but I finally got something to work.
round(round(round([Cost Rate],.01)*[Hours],.001),.01)
I round the cost rate to 2 decimal places, do the multiplication and round to 3 places, take that number and round back to 2 places
@MsBindy This issue has confounded me as well in the past. If you change your calculated field to fixed decimal with a lot of decimals (I used size 200.16) then you can see that it's internally storing it as a slightly small number than 237.895:
This can create problems for your rounding as you've noted. Note that I had workarounds in pre 11.0 versions but those loopholes have since been closed.
You're rounding twice here.
Why not just round in the CP Total DTS formula and not round in the CP Wage Rate Paid.
Round(67.965 * 3.5,.01) should equal 237.88
Cheers,Mark
In my final report I need to display the rate (to 2 decimal places), the hours, and the product of the 2 (to 2 decimal places)
My 3 columns would be:
Rate: 67.97
Hours 3.5
DTS: 237.90
Oddly, I didn't even know it wasn't working until I started to turn this workflow into In-DB and started to see pennies all over the place!
Ok...
How about this workflow to solve it?
Cheers,
Mark
Then I'm 2 cents off
I need to show all 3 fields and they have to cross-foot.
3.5 * 67.97(rounded) = 237.90(rounded)