Forráskód Böngészése

修正浮点数精度丢失问题

chendeben 1 éve
szülő
commit
b6d05ae2ab
1 módosított fájl, 1 hozzáadás és 1 törlés
  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 {