public static string P_ConvertFloat4Se5RuReturnString(string strValue)
{
Decimal d = 0;
try
{
d = Decimal.Parse(strValue);
}
catch
{
}
string dStr = Math.Round(d, 2).ToString();
return dStr;
//float flotValue = 0;
//try
//{
// flotValue = float.Parse(strValue.Trim());
//}
//catch
//{
// //MessageBox.Show("输入的浮点型字符串“" + strValue.Trim() + "”不符合要求!");
// return flotValue.ToString();
//}
//int iValue = (int)Math.Round(flotValue * 10000); //小数点后两位前移,并四舍五入
//flotValue = (float)(iValue / 10000.00f);
//return flotValue.ToString();
}
{
Decimal d = 0;
try
{
d = Decimal.Parse(strValue);
}
catch
{
}
string dStr = Math.Round(d, 2).ToString();
return dStr;
//float flotValue = 0;
//try
//{
// flotValue = float.Parse(strValue.Trim());
//}
//catch
//{
// //MessageBox.Show("输入的浮点型字符串“" + strValue.Trim() + "”不符合要求!");
// return flotValue.ToString();
//}
//int iValue = (int)Math.Round(flotValue * 10000); //小数点后两位前移,并四舍五入
//flotValue = (float)(iValue / 10000.00f);
//return flotValue.ToString();
}