Re: computing 20! all the way
Re: computing 20! all the way
- Subject: Re: computing 20! all the way
- From: Emmanuel <email@hidden>
- Date: Fri, 12 Nov 2004 22:46:49 +0100
At 9:50 AM -0800 11/12/04, Paul Berkowitz wrote:
Stringify(2.43290200817664E+18)
--> "2432902008177000000"
to Stringify(x) -- for E+ numbers
set x to x as string
set {tids, AppleScript's text item delimiters} to {AppleScript's text
item delimiters, {"E+"}}
if (count (text items of x)) = 1 then
set AppleScript's text item delimiters to tids
return x
else
set {n, z} to {text item 1 of x, (text item 2 of x) as integer}
set AppleScript's text item delimiters to tids
set i to character 1 of n
set decSepChar to character 2 of n -- "." or ","
set d to text 3 thru -1 of n
set l to count d
if l > z then
return (i & (text 1 thru z of d) & decSepChar & (text (z + 1)
thru -1 of d))
else
repeat (z - l) times
set d to d & "0"
end repeat
return (i & d)
end if
end if
end Stringify
Or:
to Stringify(x) -- for E+ numbers, up to 100 digits, for more digits
add more pounds
-- requires Satimage.osax
-- you know, that free scripting addition by Satimage-software, a must have
format x into
"####################################################################################################"
end Stringify
Stringify(2.43290200817664E+18)
--> "2432902008177000000"
Emmanuel
From Satimage-software
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden