修复商品卡片销量可能会出现余数的问题

Signed-off-by: DH <ji534@outlook.com>
pull/38/head
DH 2024-01-29 01:24:27 +00:00 committed by Gitee
parent b3754f3a48
commit 829bea3861
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
1 changed files with 1 additions and 1 deletions

View File

@ -56,7 +56,7 @@ export function formatNum(prefix, type, num) {
// 例如100 - 199 显示为 100+
// 9000 - 9999 显示为 9000+
let pow = Math.pow(10, `${num}`.length - 1);
return `${prefix}${(num / pow) * pow}+`;
return `${prefix}${Math.round((num / pow) * pow)}+`;
}
// 格式化价格