Explorar o código

修正浮点数精度丢失问题

chendeben hai 1 ano
pai
achega
b6d05ae2ab
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      entry/src/main/ets/pages/UserCenter.ets

+ 1 - 1
entry/src/main/ets/pages/UserCenter.ets

@@ -1075,7 +1075,7 @@ export struct UserCenter {
     const appName = PreferencesUtil.getStringSync('appName', 'TTMusic');
     hilog.info(0x0000, 'UserCenter', `doWxPay: current this.userId is ${this.userId}`);
     const prepayId = await createWeChatOrder(CommonConstants.WX_PAY_APPID, CommonConstants.WX_PAY_MCHID,
-      appName, Number(plan.price) * 100, pinyin4js.getShortPinyin(this.appName), this.userId, plan.id);
+      appName, Math.round(Number(plan.price) * 100), pinyin4js.getShortPinyin(this.appName), this.userId, plan.id);
     if (prepayId) {
       await this.wechatPay(prepayId);
     } else {