Never had to do that, I guess I would test for the E +,
then multiply up - but by the time you are into that kind of notation - you can only get an approximation of the number i.e. 1.234 times 10 to the power of 10 is going to loose some of the least significant digits (567890) thats the disadvantage of the format however...
To test:
myString = "1.234E + 10"
Function Scientific
parameter myString
Private myString,myNumber,mySignificant,Multi
myString = Upper(myString)
** first remove all spaces
myString = StrTran(myString," ",""

&& now its 1.234E+10
** next remove the signifant bit to the left of the E
mySignificant = Val(Left(myString,AT("E",myString)-1))
** should now have 1.234 in it
** find and work out the multiplier
Multi=val(substr(myString,AT("E",myString)+1,len(myString)))
** should get +10 / -10
** now power it up...
myNumber = mySignificant * (10 ^ Multi)
Return(myNumber)
** use it with the other bit from earlier...
Function GetVal
Parameter myString
Private myString,myNumber
if !"E"$Upper(myString)
myNumber = Val(StrTran(myString,",",""

)
else
myNumber = Scientific(myString)
endif
return(myNumber)
** and for a purely integer format...
myInteger = Int(GetVal(myString))
** Does this help...
Griff
![[smile] [smile] [smile]](/data/assets/smilies/smile.gif)
ps I bet there's an easier way!