Re: Scientific notation
Re: Scientific notation
- Subject: Re: Scientific notation
- From: Nigel Garvey <email@hidden>
- Date: Fri, 2 May 2003 12:13:49 +0100
Paul Berkowitz wrote on Thu, 01 May 2003 19:09:24 -0700:
>
my NumberToString(3.0E-4)
>
--> "0.0003"
>
>
on NumberToString(bigNumber)
[etc]
Jeffrey Mattox replied on Thu, 1 May 2003 22:39:15 -0500
>
You do good work, but all that AS for such a simple task makes me
>
cringe. How about this instead:
>
>
set theNumber to 3.0E-4
>
do shell script "perl -e 'print " & theNumber & "'"
>
--> "0.0003"
Tim Bumgarner observed on Thu, 1 May 2003 23:58:45 -0400:
>
Notice that it takes nearly one minute to execute the do shell script
>
1000 times, but only a little over a second and a half for executing
>
the NumberToString handler.
>
>
Food for thought...
I don't suppose this will interest anyone, but my own vanilla numToStr()
handler is still available on ScriptBuilders. It's even longer than
Paul's and even faster. Like the Perl script, it copes with awkward
numbers such as 8483.36, but produces a result in 1/27th of the time. :-)
<
http://files.macscripter.net/scriptbuilders/ScriptTools/numToStr.sit>
NG
_______________________________________________
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.