Преглед изворни кода

fix: 修改保留两位数方法

Before пре 7 месеци
родитељ
комит
1b7e14dba5
2 измењених фајлова са 2 додато и 2 уклоњено
  1. 1 1
      src/app/[locale]/(navbar)/withdraw/WithdrawWidget.tsx
  2. 1 1
      src/utils/methods/index.ts

+ 1 - 1
src/app/[locale]/(navbar)/withdraw/WithdrawWidget.tsx

@@ -375,7 +375,7 @@ const WithdrawWidget: FC<Props> = (props) => {
                                         wallet.current_score_rollover,
                                         wallet.target_score_rollover
                                     ) >= 100
-                                        ? (wallet.score || 0) + wallet.point
+                                        ? flatPoint((wallet.score || 0) + wallet.point)
                                         : 0}
                                     BRL
                                 </span>

+ 1 - 1
src/utils/methods/index.ts

@@ -113,7 +113,7 @@ export const percentage = (current: number, source: number) => {
  * @description 保留两位数浮点数
  */
 export const flatPoint = (num: number) => {
-    return Math.ceil(num * 100) / 100;
+    return Number(num.toFixed(2));
 };
 
 /**