Rounding Bug?

This smells like a bug to me. If Dist = 9.995, valStr should round up to 10.00. It does not. However, 9.9951 does round up. I believe it is common practice that 0.5 rounds up.


Dist = 9.9951;
if (Dist < 10.0) { valStr = Dist.format("%.2f"); } else { valStr = Dist.format("%.1f"); }