at least it was for me.
Rounding to 2 decimal places 2.475 should give you 2.48 and 2.525 should return 2.53.
But what if the values are already floats
Same SQL, same sig figs, different answer.
Rounding a float gives you a correct answer for 2.475 (2.48) but not 2.525 (2.52).
I have a solution but it's not very intuitive.
Rounding to 2 decimal places 2.475 should give you 2.48 and 2.525 should return 2.53.
But what if the values are already floats
PHP:
Select 2.475,
Round(2.475,2) as [Correct Answer],
Cast(2.475 as Float) as [CastFloat],
Convert(float,2.475) as [convertFloat],
Round(Cast(2.475 as Float),2) as [RoundedCastFloat],
Round(Convert(float,2.475),2) as [RoundedconvertFloat]
Select 2.525,
Round(2.525,2) as [Correct Answer],
Cast(2.525 as Float) as [CastFloat],
Convert(float,2.525) as [convertFloat],
Round(Cast(2.525 as Float),2) as [RoundedCastFloat],
Round(Convert(float,2.525),2) as [RoundedconvertFloat]
Same SQL, same sig figs, different answer.
Rounding a float gives you a correct answer for 2.475 (2.48) but not 2.525 (2.52).
I have a solution but it's not very intuitive.