Skip to content

Conversation

@tfrg
Copy link
Collaborator

@tfrg tfrg commented Oct 23, 2025

Summary

Added decimal conversion logic for Governance Overview token amounts to ensure proper display formatting.

Changes

1. Added convertGovernanceOverview method

  • Converts raw XGNS token amounts from API response to display format
  • Applies decimal conversion using AmountConverter for totalDelegated field
  • Returns default values when input data is null/undefined

2. Added safeConvertToNumber helper method

  • Safely converts string/number values to number type
  • Handles edge cases: null, undefined, and NaN
  • Returns 0 as fallback for invalid conversions
  • Ensures type safety for numeric operations

@vercel
Copy link

vercel bot commented Oct 23, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
gnoswap-interface Ready Ready Preview Comment Oct 28, 2025 1:20am

@tfrg tfrg changed the title feat: [GSW-2363] Explore token-amount decimals [GSW-2363] Explore token-amount decimals Oct 23, 2025
@tfrg tfrg force-pushed the GSW-2363-token-amount-decimal-2 branch from b459a09 to 66b6f13 Compare October 24, 2025 09:11
@tfrg tfrg force-pushed the GSW-2363-token-amount-decimal-2 branch from 66b6f13 to 0249641 Compare October 27, 2025 02:42
@sonarqubecloud
Copy link

@tfrg tfrg merged commit 31e4a61 into develop Oct 28, 2025
6 checks passed
@tfrg tfrg deleted the GSW-2363-token-amount-decimal-2 branch October 28, 2025 01:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants