From 2f485cebcffe1604d6ad13408057c23ab48ba966 Mon Sep 17 00:00:00 2001 From: liangping <18786721@qq.com> Date: Fri, 13 May 2022 22:34:34 +0800 Subject: [PATCH] Fixed overflow issue --- src/views/StakingRewardComponent.vue | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/views/StakingRewardComponent.vue b/src/views/StakingRewardComponent.vue index 65d10152..99b0d929 100644 --- a/src/views/StakingRewardComponent.vue +++ b/src/views/StakingRewardComponent.vue @@ -139,6 +139,10 @@ export default { methods: { formatNumber(value) { if (value < 1) return value + if (value.indexOf('.') > 0) { + // eslint-disable-next-line no-undef + return numberWithCommas(BigInt(value.substring(0, value.indexOf('.')))) + } // eslint-disable-next-line no-undef return numberWithCommas(BigInt(Number(value).toFixed(0))) },