Skip to content

[Bug] Trading widget: unformatted balance and est. cost values #789

@realproject7

Description

@realproject7

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent/T3Assigned to T3 builder agentbugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions