[Newbies] Re: Rouding Floats up to a number of decimals - Method Finder

cdrick cdrick65 at gmail.com
Wed Jul 23 15:41:54 UTC 2008


> 1.2288 roundTo: 1 "1"
> 1.2288 roundTo: 0.1  "1.2"
> 1.2288 roundTo: 0.01  "1.23"
> 1.2288 roundTo: 0.001  "1.229"
> 1.2288 roundTo: 0.0001  "1.2288"
> 1.2288 roundTo: 0.05  "1.25"
> 1.2288 roundTo: 0.002  "1.228"

Stupid me again ;)

I only tried #roundTo: with Integer.

But #printShowingDecimalPlaces: is alright ;)

Thanks...

Cédrick


More information about the Beginners mailing list