소스 검색

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));
 };
 
 /**