Re: How to convert number from exponential form?
Re: How to convert number from exponential form?
- Subject: Re: How to convert number from exponential form?
- From: KOENIG Yvan <email@hidden>
- Date: Mon, 12 Jan 2009 15:16:32 +0100
Le 12 janv. 2009 à 14:02, Dave a écrit :
Maybe this handler may help:
set nn to my convert(1.0139648E+9)
log "nn = " & nn
--=============
on convert(n)
if (n as text) contains "E+" then
set l1 to my decoupe(n, "E+")
set n1 to (item 1 of l1)
set n11 to (n1 div 1) as text
set n12 to text -((count of n1) - (count of n11) - 1) thru -1 of n1
set n to n11 & n12 & text -((item 2 of l1) - (count of n12)) thru
-1 of "0000"
end if
return n
end convert
--=============
on decoupe(t, d)
local l
set t to t as text
set AppleScript's text item delimiters to d
set l to text items of t
set AppleScript's text item delimiters to ""
return l
end decoupe
--=============
Yvan KOENIG (from FRANCE lundi 12 janvier 2009 15:16:19)
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden