Problem
The trading widget shows raw 18-decimal values without formatting:
- Balance:
5034.425044895956140455 HUNT — should be 5,034.43 HUNT
- Est. cost:
68.623631443223832041 HUNT — should be 68.62 HUNT
Fix
Format balance and est. cost displays to a reasonable precision:
- Values >= 1: 2 decimal places (e.g.
5,034.43)
- Values < 1 but >= 0.001: 4 decimal places (e.g.
0.0033)
- Values < 0.001: 6 decimal places or scientific notation
- Add thousands separators for large numbers
Apply to all pay token modes (ETH, USDC, HUNT, PLOT).
File
src/components/TradingWidget.tsx — balance display and est. cost display
Branch
task/789-trading-format
Problem
The trading widget shows raw 18-decimal values without formatting:
5034.425044895956140455 HUNT— should be5,034.43 HUNT68.623631443223832041 HUNT— should be68.62 HUNTFix
Format balance and est. cost displays to a reasonable precision:
5,034.43)0.0033)Apply to all pay token modes (ETH, USDC, HUNT, PLOT).
File
src/components/TradingWidget.tsx— balance display and est. cost displayBranch
task/789-trading-format