It might have been different before the last couple of Director releases, but every time I've tested it recently, the integer() function rounds normally, both up and down.
Charlie Fiskeaux II Media Designer The Creative Group www.cre8tivegroup.com 859/858-9054x29 cell: 859/608-9194 ----- Original Message ----- From: "Tab Julius" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Tuesday, June 17, 2003 8:04 AM Subject: Re: <lingo-l> rounding numbers.... > > The integer() function in Lingo happens to round UP (some languages it > rounds down, or just acts as a trunc() (truncate) function. Lingo doesn't > have a truncate function. > > To round up, just do: > > result =integer(myNumber) > > To round down, you have to subtract .5: > > result =integer(myNumber - .5) > > So since you're going up, just use the integer() function. > > - Tab > > > At 07:13 AM 6/17/03, Chris Aernoudt wrote: > >Hi, > > > >Silly question; i need to round a number to the next integer... I'd use > >ceil(), but since lingo seems to lack actual rounding functions... > > > >How do you generally do this??? I thought of checking the first decimal > >for > 0, adding 1 if so, setting the floatprecision to 0, converting to > >a string and back to a number, but that seems really messy for something > >this stupid... > > > >Thanks, > > > >Chris. > > > >[To remove yourself from this list, or to change to digest mode, go to > >http://www.penworks.com/lingo-l.cgi To post messages to the list, email > >[EMAIL PROTECTED] (Problems, email [EMAIL PROTECTED]). Lingo-L > >is for learning and helping with programming Lingo. Thanks!] > > [To remove yourself from this list, or to change to digest mode, go to http://www.penworks.com/lingo-l.cgi To post messages to the list, email [EMAIL PROTECTED] (Problems, email [EMAIL PROTECTED]). Lingo-L is for learning and helping with programming Lingo. Thanks!] > [To remove yourself from this list, or to change to digest mode, go to http://www.penworks.com/lingo-l.cgi To post messages to the list, email [EMAIL PROTECTED] (Problems, email [EMAIL PROTECTED]). Lingo-L is for learning and helping with programming Lingo. Thanks!]
