How about
:
String num = "29%";
double nums = double.Parse(num.Substring(0, num.IndexOf('%'))) / 100D;
--
HTH,
Kevin Spencer
Microsoft MVP
..Net Developer
If you push something hard enough,
it will fall over.
- Fudd's First Law of Opposition
"Mike9900" <Mi******@discussions.microsoft.com> wrote in message
news:F1**********************************@microsof t.com...
I use this code, but I get exception:
String num = "29%";
System.Globalization.NumberFormatInfo ni = new
System.Globalization.NumberFormatInfo(); ni.PercentSymbol = "%";
double nums = double.Parse(num, System.Globalization.NumberStyles.Any,
ni);
Is there a way to parse the percent value by using IFormatProvider?
--
Mike