• 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: How to convert number from exponential form?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
References: 
 >How to convert number from exponential form? (From: Dave <email@hidden>)

  • Prev by Date: Where to log lines go
  • Next by Date: Re: How to convert number from exponential form?
  • Previous by thread: How to convert number from exponential form?
  • Next by thread: Re: How to convert number from exponential form?
  • Index(es):
    • Date
    • Thread