I am trying to calculate percentages of dollar values. At 50%, sometimes you get half a penny, and I need to round it to the nearest cent.
In Sql, my calculation is as follows:
round(retail * 0.5, 2, 0)
If I accept the following values, I get different results:
Without the environment, I get:
When rounding, I get:
I am told that this is a form of "rounding up bankers," but it seems that the value that affects the direction of rounding is an integer value.
My problem is that I expect the upper value to be rounded to 2.20. If this is really rounding up bankers, and it is affected by an integer value, does anyone have an example to prevent this behavior. If this is not rounding up bankers, can someone please provide an explanation and maybe a solution to just get the normal rounding behavior?
Thanks in advance!
source share