Sunday, July 5, 2020

#26 2019-02-12 01:16:43 am

Shane Stanley
Member
From:: Australia
Registered: 2002-12-07
Posts: 6395

Re: Converting exponential numbers to real numbers

Ironically, the one real-world place where doubles lack sufficient precision in AppleScript is in accurately representing large integers.


Shane Stanley <sstanley@myriad-com.com.au>
www.macosxautomation.com/applescript/apps/
latenightsw.com

Offline

 

#27 2020-05-14 05:59:11 pm

zevrix
Member
Registered: 2012-08-01
Posts: 37

Re: Converting exponential numbers to real numbers

I was just looking up the same topic (not sure why I never did in the last 15 years).

I came upon at a much easier solution on Ask Different - it looks like we can just convert a number to a measurement then to string:

Applescript:

1.2345E+9 as inches as string

will return "1234500000".

Any measurement can be used (kilograms, gallons etc.)

Looks like it saves a few lines of code.

Or is it well known by now?


To give proper credit credit - here's the link (the answer at the bottom):

https://apple.stackexchange.com/questio … rt-numbers

Offline

 

#28 2020-05-14 07:51:17 pm

Shane Stanley
Member
From:: Australia
Registered: 2002-12-07
Posts: 6395

Re: Converting exponential numbers to real numbers

zevrix wrote:

Or is it well known by now?



You'll find it back in message #19 of this thread.


Shane Stanley <sstanley@myriad-com.com.au>
www.macosxautomation.com/applescript/apps/
latenightsw.com

Offline

 

#29 2020-05-14 08:27:25 pm

zevrix
Member
Registered: 2012-08-01
Posts: 37

Re: Converting exponential numbers to real numbers

Shane Stanley wrote:
zevrix wrote:

Or is it well known by now?



You'll find it back in message #19 of this thread.



oops missed it - thanks Shane

Offline

 

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)