diff --git a/assets/script/game/map/HeroBoxComp.ts b/assets/script/game/map/HeroBoxComp.ts index ef1a86eb..790c5c46 100644 --- a/assets/script/game/map/HeroBoxComp.ts +++ b/assets/script/game/map/HeroBoxComp.ts @@ -21,7 +21,7 @@ import { GameEvent } from "../common/config/GameEvent"; import { HeroInfo } from "../common/config/heroSet"; import { HeroAttrsComp } from "../hero/HeroAttrsComp"; import { Hero } from "../hero/Hero"; -import { FacSet, FightSet, getLvColor } from "../common/config/GameSet"; +import { FacSet, FightSet, getLvColor, NumberFormatter } from "../common/config/GameSet"; import { buildSkillDesc, ISkillDescSource } from "../common/config/HeroSkillDesc"; import { MissionEconomy } from "./MissionEconomy"; import { UIID } from "../common/config/GameUIConfig"; @@ -592,7 +592,8 @@ export class HeroBoxComp extends CCComp { * @param decimals 保留小数位数(默认 0,取整) */ private setStatRow(allLabel: Label | null, plusLabel: Label | null, total: number, bonus: number, suffix: string = "", decimals: number = 0) { - const fmt = (v: number) => decimals > 0 ? v.toFixed(decimals) : `${Math.floor(v)}`; + // 整数数值统一走 NumberFormatter 千分位缩写(如 12.3k),避免大数值溢出标签 + const fmt = (v: number) => decimals > 0 ? v.toFixed(decimals) : NumberFormatter.formatNumber(Math.floor(v)); if (allLabel && allLabel.isValid) { allLabel.string = `${fmt(total)}${suffix}`; }