Forum Navigation
Floating point rounding
Posted: 09/09/08 10:32:16I would like to round a floating point to fewer digits, but I cannot find any functions for this.
Say I want to round 1.05 to one decimal and get 1.1. I don't want to first convert it to text and then back to a float :) I did a quick look at the tango.text.convert.Float format function, but it's a bit over my head to steal anything from there.
Is there something in the c runtime, or some other simple technique I can use?












