The task that we have comes down to the following two statements:
select convert(float, (convert(float,5741.61)/convert(float, 196.00)) * convert(float,14.00)) as unrounded, round(convert(float, (convert(float,5741.61)/convert(float, 196.00)) * convert(float,14.00)), 2) as roundedTo2dp select convert(float, 410.115) as unrounded, ROUND( convert(float, 410.115), 2) as roundedTo2dp
The first operator uses float to calculate the value 410.115, as well as the result with rounding () to 2 decimal places. The rounded value is displayed at 410.11.
The second statement uses a float value of 410.115, and also rounds it to two decimal places. The result of rounding is obtained as 410.12.
Why is one rounding down and another rounding when the value is rounded the same way?
How can I get the first statement to round to 410.12?
EDIT: apologies for formatting - stackoverflow does not show any formatting on this computer (very strange).
source share