On 12/30/05, Anthony Borla <[EMAIL PROTECTED]> wrote: > > ----- 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 > > =3D=3D 123.46 > > >> round/to 123.456 0.1 > > =3D=3D 123.5 > > >> round/to 123.456 1 > > =3D=3D 123 > > >> round/to 123.456 10 > > =3D=3D 120 > > > > You can even do things like: > > > > >> round/to 123.456 3 > > =3D=3D 123 > > >> round/to 123.456 7 > > =3D=3D 126 > >
Which is more usefull like this: !>>round/to now/time :15:0 =3D=3D 16:45 (my two seconds ;) > > 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. > > -- -Volker "Any problem in computer science can be solved with another layer of indirection. But that usually will create another problem." David Wheeler -- To unsubscribe from the list, just send an email to lists at rebol.com with unsubscribe as the subject.
