/// <summary>
/// str转金额 元
/// </summary>
/// <param name="money"></param>
/// <param name="type">分100 毛10</param>
/// <returns>str</returns>
public static Double strToDouble(string money, int type)
{
if (String.IsNullOrEmpty(money))
{
money = "0";
}
string temp = "0";
//去开头0
temp = money.TrimStart(‘0‘).Trim();
if (String.IsNullOrEmpty(temp))
{
temp = "0";
}
return Convert.ToDouble(temp) / type;
}
时间: 2024-11-03 12:43:27