Skip to content

Conversation

@Klakurka
Copy link
Member

@Klakurka Klakurka commented Jul 6, 2025

Related to #492.

Description

Fixed wallet balance display formatting to show consistent decimal places across different cryptocurrencies:

  • XEC Balance: Now displays exactly 2 decimal places (e.g., "1,234.56 XEC")
  • BCH Balance: Now displays exactly 4 decimal places (e.g., "0.1234 BCH") - 8 felt too much but we could do that.
  • Locale Support: Uses the user's browser locale for number formatting (respects international formatting preferences for thousands separators and decimal points)

This provides a more consistent and professional appearance for wallet balances while maintaining appropriate precision for each cryptocurrency type.

Test plan

  1. Open /wallets.
  2. View wallet with XEC balance: Verify XEC balance shows exactly 2 decimal places
  3. View wallet with BCH balance: Verify BCH balance shows exactly 4 decimal places
  4. Test different locales: Change browser language/locale settings and verify number formatting adapts appropriately (e.g., comma vs period for decimal separator)
  5. Test edge cases:
    • Very small balances (should still show required decimal places)
    • Large balances (should show thousands separators according to locale)
    • Zero balances (should not display balance sections)

- XEC balance now shows exactly 2 decimal places
- BCH balance now shows exactly 4 decimal places
- Uses user's browser locale for number formatting
@Klakurka Klakurka added this to the Phase 3 milestone Jul 6, 2025
@Klakurka Klakurka requested a review from chedieck July 6, 2025 06:08
@Klakurka Klakurka added the bug Something isn't working label Jul 6, 2025
@Klakurka
Copy link
Member Author

Klakurka commented Jul 6, 2025

I get a weird 'hydration' error locally when I refresh the /wallets page but it also happens on master so I'm not sure what that is.

@Klakurka Klakurka merged commit ff1c7f8 into master Jul 15, 2025
2 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants