Skip to content

good first issue: use actual token decimals instead of hardcoded 7 in analytics charts #367

Description

@Austinaminu2

Description

`components/analytics/charts.tsx:67,87` hardcodes `formatTokenAmount(token.amount, 7)` instead of using the token's actual decimals. The `TokenShare` type doesn't even carry a `decimals` field, so any custom token with a decimals value other than 7 (XLM's decimals) displays the wrong amount in the analytics chart.

Location

`components/analytics/charts.tsx:67, 87`

Task

Add a `decimals` field to the `TokenShare` type, populate it from the token metadata where `TokenShare` objects are constructed, and use that value instead of the hardcoded `7` in both chart call sites.

Good for newcomers because

Clear, well-scoped data-correctness bug affecting a specific, easy-to-verify display (chart amounts for non-XLM tokens).

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programbugSomething isn't workingfrontendNext.js frontendgood first issueGood for newcomers

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions