• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: limiting numeric runs
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >Re: limiting numeric runs (From: Paul Skinner <email@hidden>)

  • Prev by Date: Re: Scripts won't launch
  • Next by Date: Re: limiting numeric runs
  • Previous by thread: Re: limiting numeric runs
  • Next by thread: Re: limiting numeric runs
  • Index(es):
    • Date
    • Thread