BUG: Guardian armor display shows stray "000" text after percentage #240
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Bug Description
In the Spire summary tab, the Next Guardian card at floor 10 displays the armor value as "Armor: 10%" followed by stray "000" text.
Steps to Reproduce
Root Cause
The stray "000" text is likely from the
fmt()function insrc/lib/game/utils/formatting.tswhich uses.toFixed(2)and.toFixed(1)for K/M/B formatting. The concatenated result of(5000/1000).toFixed(1) + 'K'produces values like "5.0K" where the trailing zero and formatting artifacts appear as stray text when adjacent JSX span elements don't have proper text boundaries.Additionally, the guardian stats (HP, Shield, Barrier, Regen) sections may have conditional rendering where a value like
0for a non-existent stat gets partially rendered before the guard condition kicks in.Files Involved
src/components/game/tabs/SpireSummaryTab.tsx— Guardian stat renderingsrc/lib/game/utils/formatting.ts—fmt()function number formatting✅ Fixed guardian armor display stray text. Extracted stat formatters (fmtArmor, fmtShield, fmtBarrier, fmtRegen) into helper functions that return properly isolated JSX elements. Split SpireSummaryTab.tsx into main component (123 lines) + helpers file (250 lines) to stay under 400-line limit.