----- Original Message ----- From: "Gabriele Santilli" <[EMAIL PROTECTED]> To: "Anthony Borla" <[EMAIL PROTECTED]> Sent: Friday, December 30, 2005 11:14 PM Subject: [REBOL] Re: REBOL Newbie: Floating Point Rounding / Formatting Function ?
Gabriele, > > Hi Anthony, > > On Friday, December 30, 2005, 11:46:01 AM, you wrote: > > AB> Sure, I tried that, but the result it gives is an integer. > For example, > AB> doing: > > AB> round 123.456 > > AB> gives an integer result: > > AB> 123 > > AB> At first I thought /scale could be used to achieve such > rounding, but all my > AB> attempts at doing so have failed. For example: > > AB> round 123.456 /scale 2 > > AB> gives an integer result of: > > AB> 2 > > AB> I've obviously misunderstood how /scale is used. > > >> round/to 123.456 0.01 > == 123.46 > >> round/to 123.456 0.1 > == 123.5 > >> round/to 123.456 1 > == 123 > >> round/to 123.456 10 > == 120 > > You can even do things like: > > >> round/to 123.456 3 > == 123 > >> round/to 123.456 7 > == 126 > Interesting. And far more versatile than my misdirected efforts had shown. Thank you. Cheers, Anthony Borla -- To unsubscribe from the list, just send an email to lists at rebol.com with unsubscribe as the subject.
