feat(cp排行榜): 金币计算方法调整

This commit is contained in:
hzj 2026-01-21 12:04:22 +08:00
parent 6871fce39e
commit ccc4ef24f4

View File

@ -590,11 +590,17 @@ const formatLargeNumber = (num) => {
const absNum = Math.abs(num)
if (absNum >= 1000000) {
return (num / 1000000).toFixed(2) + 'M'
//
const millionValue = num / 1000000
const truncatedValue = Math.trunc(millionValue * 100) / 100
return truncatedValue.toFixed(2) + 'M'
} else if (absNum >= 1000) {
return (num / 1000).toFixed(2) + 'K'
//
const thousandValue = num / 1000
const truncatedValue = Math.trunc(thousandValue * 100) / 100
return truncatedValue.toFixed(2) + 'K'
} else {
return num.toString()
return Math.floor(num).toString()
}
}