fix(analytics): use token decimals instead of hardcoded 7 (FlowwStar/FlowStar#367)#404
Open
jdjioe5-cpu wants to merge 1 commit into
Open
fix(analytics): use token decimals instead of hardcoded 7 (FlowwStar/FlowStar#367)#404jdjioe5-cpu wants to merge 1 commit into
jdjioe5-cpu wants to merge 1 commit into
Conversation
) Closes FlowwStar#367. - components/analytics/charts.tsx: add `decimals: number` to TokenShare and replace the hardcoded `formatTokenAmount(amount, 7)` at lines 67 and 87 with `formatTokenAmount(amount, token.decimals)` so custom tokens render with their own decimals in both the top-tokens card and the token-distribution card. - app/app/analytics/page.tsx: extend the AnalyticsSnapshot.TokenShare shape (both tokenShares and topTokens) to include `decimals`, and copy `decimals` from the existing tokenGroups entry in the tokenShares constructor at line ~122. No behavior change for XLM (decimals=7). Custom-token analytics now display the correct decimal place.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #367. Adds decimals field to TokenShare type and uses token.decimals instead of hardcoded 7 in formatTokenAmount at charts.tsx:67 and :87.