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

This commit is contained in:
hzj 2026-01-21 18:19:36 +08:00
parent 4dac4c2562
commit 214daf2c75

View File

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