微信支付失败,返回invalid total_fee,金额不能出现小数点
所以我们系统如果是以元为单位要处理下金额,即先乘以100,再去小数点
"result": {
"return_msg": "invalid total_fee",
"return_code": "FAIL"
},
(Math.Round((decimal)order.Amount * 100, 0)).ToString()
如果金额为少一分钱
例:
//这样会少一分钱
public static void main(String [] str){
String a = "18.90";
Double d = Double.parseDouble(a);
d = d * 100;
Long totalL = d.longValue();
System.out.println(totalL);
}
//完美解决
public static void main(String [] str){
String a = "18.90";
Double d = Double.parseDouble(a);
d = d * 1000 / 10;
Long totalL = d.longValue();
System.out.println(totalL);
}