如何将百分数字符串转换为数值
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