Re: newbie question: real with fraction to int
Re: newbie question: real with fraction to int
- Subject: Re: newbie question: real with fraction to int
- From: Paul Berkowitz <email@hidden>
- Date: Fri, 24 Oct 2003 09:58:19 -0700
On 10/24/03 8:39 AM, "leo" <email@hidden> wrote:
>
i want to assign a real to an integer but casting or ("coerceing" in AS)
>
works only for non fractional reals. so, the line
>
>
set i to 9.5 as integer
>
>
gives an error. how can i truncate a value to an int regardless of the
>
fraction ? i looked thoroughly in the ASLanguageGuide but couldn't find
>
anything.
1. round 9.5
--> 10
There are lots of options for rounding if you don't like the default (10):
[rounding up/down/toward zero/to nearest/as taught in school]
Check Standard Additions dictionary in Scripting Additions.
2. Wait until Panther arrives at your door. Then try your coercion again.
--
Paul Berkowitz
[demime 0.98b removed an attachment of type application/pkcs7-signature which had a name of smime.p7s]
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.