decimal扩展方法(转换为字符串,去掉末尾的0)
/// <summary> /// 转换为字符串,去掉末尾0 /// </summary> /// <param name="target">被转换的对象</param> /// <returns>去掉末尾0的decimal</returns> public static string RemoveLastZero(this decimal target) { return target.ToString("G0"); }
/// <summary> /// 转换为字符串,去掉末尾0 /// </summary> /// <param name="target">被转换的对象</param> /// <returns>去掉末尾0的decimal</returns> public static string RemoveLastZero(this decimal target) { return target.ToString("G0"); }