Re: Rounding numbers up
Re: Rounding numbers up
- Subject: Re: Rounding numbers up
- From: Paul Berkowitz <email@hidden>
- Date: Fri, 16 Mar 2001 17:03:34 -0800
On 3/16/01 12:05 AM, I wrote:
>
Wow. Lots of odd syntax there, that doesn't mean anything in AS. Maybe you
>
mean
>
>
if mod (x / 1) /= 0 then
>
set x to div (x / 1) + 1
>
else
>
set x to div (x / 1)
>
end if
>
>
?
>
Sorry, I didn't help much by perpetuating some of the poor syntax. That
_should_ have been:
if x mod 1 /= 0 then
set x to (x div 1) + 1
else
set x to (x div 1)
end if
--
Paul Berkowitz
>
>
On 3/15/01 11:18 PM, "Pitcher, George" <email@hidden> wrote:
>
>
> How about using mod?
>
>
>
> if mod (x/1) <> 0 x=x+1
>
>
>
> I know it's not AS syntax but I don't need to do that sort of stuff so
>
> never bothered to check it out.
>
>
>
> HTH
>
>
>
> George P in Edinburgh
>
>
>
>> -----Original Message-----
>
>> From: Edmond Cho [mailto:email@hidden]
>
>> Sent: 16 March 2001 06:52
>
>> To: email@hidden
>
>> Subject: Rounding numbers up
>
>>
>
>>
>
>> I remember seeing a method to do this, but have been unable
>
>> to find any
>
>> reference to rounding numbers in the Language Guide.
>
>>
>
>> The calculation I am after is not strictly rounding to the
>
>> nearest integer
>
>> but rounding UP to the next whole number.
>
>>
>
>> 1.6 ---> 2
>
>> 2.1 ---> 3
>
>> 1.4 ---> 2
>
>>
>
>> So, any remainder results in rounding up.
>
>> Any tips?
>
>>
>
>> Thanks.
>
>> Ed Cho
>
>> Colorhythm
>
>> _________________________________________________________________
>
>> Get your FREE download of MSN Explorer at http://explorer.msn.com
>
>> _______________________________________________
>
>> applescript-users mailing list
>
>> email@hidden
>
>> http://www.lists.apple.com/mailman/listinfo/applescript-users
>
> _______________________________________________
>
> applescript-users mailing list
>
> email@hidden
>
> http://www.lists.apple.com/mailman/listinfo/applescript-users
>
>
>
--
Paul Berkowitz