Jump to content

scientific numbers to human readable conversion?


Recommended Posts

how can i transform a number like this ( -2e-006 ) into a human readable number like this (0.000000448787) ?

i tried round(), number() and lots of other functions but i might have missed something..

sorry for the noob question :D

cheers//

strikeout

Link to comment
Share on other sites

try this:

ConsoleWrite(Execute(-2^-006) & @CRLF)

Dating a girl is just like writing software. Everything's going to work just fine in the testing lab (dating), but as soon as you have contract with a customer (marriage), then your program (life) is going to be facing new situations you never expected. You'll be forced to patch the code (admit you're wrong) and then the code (wife) will just end up all bloated and unmaintainable in the end.

Link to comment
Share on other sites

Demo:

Global $sInput = "-2e-006"
ConsoleWrite("Debug: $sInput = " & $sInput & ", Type = " & VarGetType($sInput) & @LF)

Global $fRET = Execute($sInput)
ConsoleWrite("Debug: $fRET = " & $fRET & ", Type = " & VarGetType($fRET) & @LF)

$sRET = StringFormat("%1.10f", $fRET)
ConsoleWrite("Debug: $sRET = " & $sRET & ", Type = " & VarGetType($sRET) & @LF)

:D

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

Demo:

Global $sInput = "-2e-006"
 ConsoleWrite("Debug: $sInput = " & $sInput & ", Type = " & VarGetType($sInput) & @LF)
 
 Global $fRET = Execute($sInput)
 ConsoleWrite("Debug: $fRET = " & $fRET & ", Type = " & VarGetType($fRET) & @LF)
 
 $sRET = StringFormat("%1.10f", $fRET)
 ConsoleWrite("Debug: $sRET = " & $sRET & ", Type = " & VarGetType($sRET) & @LF)

:D

Neat!
Link to comment
Share on other sites

try this:

ConsoleWrite(Execute(-2^-006) & @CRLF)
Well, that's cute, but doesn't address scientific notation as the initial input. It's also the wrong answer:

-2e-006 = (-2)(10 ^ -6) = 0.000002

:D

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

I have never needed or found a use for this kind of number

0.000002

.... Well, maybe excepting my bank account balance... :D

8)

Isn't that your fraction of the CA state budget deficit?

:D

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...