--- Mat Bettinson <[EMAIL PROTECTED]> wrote:
> Folks,
> 
> >> print to-integer 1.6
> 1
> 
> I can't for the life of me find a word which does
> the same as this but
> which actually rounds (so you'd get 2) rather than
> just chopping off
> the remainder.
> 
> Is there such a beast or must one write a function
> to do it?

I don't think there is one, but it shouldn't be too
ugly. Rounding fractions >=0.5 away from 0, do this:

round-off: func [ x [number!] ] [ 
  return either greater? x 0 [ 
    to-integer x + 0.5 
  ] [ 
    to-integer x - 0.5 
  ] 
]


__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com
-- 
To unsubscribe from this list, please send an email to
[EMAIL PROTECTED] with "unsubscribe" in the 
subject, without the quotes.

Reply via email to