如何将百分数字符串转换为数值
string s = "80% ";
double d = Convert.ToDouble(s);
出错.
如何实现?
------解决方案--------------------string s = "80% ";
double d = Convert.ToDouble(s.TrimEnd( '% ')) / 100;
Text = d.ToString();
------解决方案--------------------Convert.ToDecimal(s.TrimEnd( '% '))/100