strikeout Posted June 4, 2009 Posted June 4, 2009 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 cheers// strikeout
James Posted June 4, 2009 Posted June 4, 2009 (edited) Perhaps: ConsoleWrite(Execute(-2e-006) & @CRLF) Edited June 4, 2009 by JamesBrooks Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ
strikeout Posted June 4, 2009 Author Posted June 4, 2009 nope, sorry. ConsoleWrite(Execute(-2e-006) & @CRLF) returns --> -2e-006
James Posted June 4, 2009 Posted June 4, 2009 nope, sorry. ConsoleWrite(Execute(-2e-006) & @CRLF) returns --> -2e-006Oh, sorry, I don't know then. Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ
LurchMan Posted June 4, 2009 Posted June 4, 2009 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.
PsaltyDS Posted June 4, 2009 Posted June 4, 2009 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) 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
James Posted June 4, 2009 Posted June 4, 2009 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) Neat! Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ
PsaltyDS Posted June 4, 2009 Posted June 4, 2009 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 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
Valuater Posted June 4, 2009 Posted June 4, 2009 I have never needed or found a use for this kind of number 0.000002 .... Well, maybe excepting my bank account balance... 8)
PsaltyDS Posted June 4, 2009 Posted June 4, 2009 I have never needed or found a use for this kind of number 0.000002.... Well, maybe excepting my bank account balance... 8)Isn't that your fraction of the CA state budget deficit? 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
strikeout Posted June 4, 2009 Author Posted June 4, 2009 $sRET = StringFormat("%1.10f", $fRET) just what i was looking for! works like a charm! thank you very much!
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now