Re: limiting numeric runs
Re: limiting numeric runs
- Subject: Re: limiting numeric runs
- From: Donald Goyette <email@hidden>
- Date: Fri, 10 Jan 2003 10:40:07 -0500
On 1/9/03 2:18 PM, "Paul Skinner" <email@hidden> wrote:
>
Here's the issue in a nutshell. I'm parsing plists and the precision
>
for reals in plists are too large for applescript to handle. If you try
>
to compile 0.83050847053527832 it will error with 'Syntax error. some
>
object'. I need to be able to limit the precision. Truncating is fine
>
for my purposes.
If you just need to be sure the plist real is truncated enough for
AppleScript to handle and aren't concerned with chopping it down to a
specific number of digits, something like
set bigNumString to "0.83050847053527832"
set bigNum to ""
repeat until bigNum is not "" or length of bigNumString is 0
try
set bigNum to bigNumString as real
on error
set bigNumString to text 1 thru -2 of bigNumString
end try
end repeat
might serve.
Don
--
Don Goyette <email@hidden>
_______________________________________________
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.