• 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: BIG number as string
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: BIG number as string


  • Subject: Re: BIG number as string
  • From: Kai Edwards <email@hidden>
  • Date: Thu, 19 Dec 2002 04:45:00 +0000

on 19/12/02 1:37 am, I wrote:

> I'm on digests, so you may have already come back on this - but here's a quick
> fix anyway (which may still include other warts):

Well it included at least one:

===============================

on numToTxt(n)
set {t, l} to {n as string, ""}
if "E" is not in t then return t
if t starts with "-" then set {l, t} to {"-", t's text 2 thru -1}
set {tid, text item delimiters} to {text item delimiters, "E"}
tell t's text items to set {i, d, s, x} to item 1's [NO BREAK]
{text 1 thru 1, text 3 thru -1} & item 2's {text 1 thru 1, text 2 thru -1}
set {text item delimiters, m, p, x, y, z} to {tid, s = "-", [NO BREAK]
(0.0 as string)'s text 2 thru 2, x as number, d's length, ""}
if m then
set {y, z} to {1, "0" & p}
if d = "0" then set d to ""
else if y > x then
tell x - y to set d to d's text 1 thru it & p & d's text (it + 1) thru -1
end if
repeat x - y times
set z to z & "0"
end repeat
if m then return l & z & i & d
l & i & d & z
end numToTxt

===============================

...and even if there ARE any more, I'm still going to bed now anyway...

--
Kai
_______________________________________________
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: BIG number as string (From: Kai Edwards <email@hidden>)

  • Prev by Date: Re: Monitor Folder For Changes
  • Next by Date: Unicode and ASCII issues
  • Previous by thread: Re: BIG number as string
  • Next by thread: Re: BIG number as string
  • Index(es):
    • Date
    • Thread