Click here to Skip to main content
15,892,537 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Hi folks, I'm using vb2010.
Trying to parse this string 8.29933968E-04 into a number so I can plot in on a spreadsheet.


if this number were like 1283912839E-5(that is, 'integer'&(E-xxx) , without the decimal point in the number ) , then I could've used

string x = "1283912839E-5"
decimal dec = Decimal.Parse( x, NumberStyles.AllowExponent )

but this does not work for my number.
What should I use?

Thx
Posted

Try:
C#
string s = " 8.29933968E-04";
decimal d = decimal.Parse(s, System.Globalization.NumberStyles.Float);
 
Share this answer
 
Your "string" is not a valid exponent. It's missing a decimal point.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900