Translate string with an "E" in it to a Number

Daveyk01

Registered User.
Local time
Today, 10:53
Joined
Jul 3, 2007
Messages
144
Hello there,

How do I translate a string such as "123E-3" to a number, such as .123?

Is there a built in function for that?
 
No I don't think so. Who would that string become .123
 
Use the Val function.

If you put Val(123E-3) you will get .123
 
Use the Val function.

If you put Val(123E-3) you will get .123


Ahhhhh!!! I had a brain fart! That simple, eh? I tried everything but that because I "knew" that would not work! I feel bloody silly now!


Thanks much,

Dave
 
No problem. When I'm not sure about those, I pull out my sample db that I use for testing and run a quick test to make sure I'm correct before posting it. So, I actually tried it out before posting as I wasn't sure either. :)
 
No problem. When I'm not sure about those, I pull out my sample db that I use for testing and run a quick test to make sure I'm correct before posting it. So, I actually tried it out before posting as I wasn't sure either. :)


Gosh I was tired and I am no where close to releasing to new revision. This database is actually an instrument test program. I used VBA instead of VB6 becasue it so easy to store records in a database and work with the data. It is much harder to distribute, but I am not worried about that.

My biggest problem is that I will work within access or VB heavily for months and then not touch it for months again and I get real rusty in those months that I don't touch it.

Now, I want to format 8.0096E-08 to look like 80.1ns. Working on that now.

Thanks for you help.
 
Should be something like
nS: Format((Val([Sci_NotationString])*1000000000),"0.0")
 
Should be something like
nS: Format((Val([Sci_NotationString])*1000000000),"0.0")

[I[/I]

I ended up doing this:
'
X = InStr(strWidth, "E")
W = Val(Left(strWidth, X - 1))
Y = Len(strWidth)
Z = Abs(Val(Mid(strWidth, X + 1, Len(strWidth) - X))) + 1
V = 10 ^ Z
PulseWidth = Val(strWidth) * V
'
tdsGetValidPulserWidth = PulseWidth
'

This seems to work
 

Users who are viewing this thread

Back
Top Bottom