日期:2014-05-17  浏览次数:20453 次

如何精确到小数点后2位?
比如 string str7="98.9870"

我只想获取98.98这个字符串

不能用Math.Round,因为会有四舍五入

请问应该如何解决这个问题?

------解决方案--------------------
string str7="98.9870";
str7 = Regex.Match(str7, "\d+(\.\d{1,2})").Value;
------解决方案--------------------
刚卡了,哥回复的6L不见了
其实只是想说用IndexOf + Substring