Skip to content

Conversation

@Signor1
Copy link
Contributor

@Signor1 Signor1 commented Dec 24, 2025

Closes #951

Description

This PR implements subscript notation for displaying very small amounts (e.g., 0.0₅1 instead of 0.000001) across the Mobile Wallet, Desktop Wallet, and Explorer. This improves readability for token amounts with many leading zeros.

Changes

  • Implemented standard subscript formatting utilities in the shared package.
  • Updated [formatAmountForDisplay] to support optional subscript formatting.
  • Enabled subscript notation in Desktop Wallet, Mobile Wallet, and Explorer Amount components.
  • Added specific styling for subscript characters (secondary font color) in Desktop and Explorer.
  • Added comprehensive unit tests for the new formatting logic.

Verification

  • Unit tests passed (pnpm test packages/shared)
  • Linting and Typechecking passed (pnpm check)
  • Visual verification in Desktop, Mobile, and Explorer

@changeset-bot
Copy link

changeset-bot bot commented Dec 24, 2025

🦋 Changeset detected

Latest commit: d580a2b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 6 packages
Name Type
@alephium/shared Minor
alephium-desktop-wallet Minor
@alephium/mobile-wallet Minor
@alephium/explorer Minor
@alephium/keyring Patch
@alephium/shared-react Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Member

@nop33 nop33 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello, I'm back from my holidays!

Very good job 👏
I'll do some functional tests next, in the meantime would you mind having a look at the small comments I have?

@Signor1 Signor1 force-pushed the feature/use-subscripts branch from 58ea9ec to c511f37 Compare January 5, 2026 14:40
@Signor1
Copy link
Contributor Author

Signor1 commented Jan 5, 2026

Hello, I'm back from my holidays!

Very good job 👏 I'll do some functional tests next, in the meantime would you mind having a look at the small comments I have?

Welcome back @nop33 !

I have made the corrections

Copy link
Member

@nop33 nop33 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the reply!

One issue I found when testing the apps is that the color fo the subscript doesn't follow the color of the rest of the amount text. The following screenshot is an example of the transactions list amounts in the desktop wallet. Since it's an incoming transaction, the wallet changes the color of the amount to green, but the subscript amount remains gray. Could you please have a look?

image

PS: On mobile wallet it seems that it works correctly

image

@Signor1
Copy link
Contributor Author

Signor1 commented Jan 6, 2026

Hi @nop33 , I have update the color to inherit the parent's

@nop33 nop33 added the ALPH-1000 label Jan 7, 2026
@nop33 nop33 merged commit 7f75cb5 into alephium:master Jan 7, 2026
4 of 5 checks passed
@nop33
Copy link
Member

nop33 commented Jan 7, 2026

Thanks a lot for this contribution!

@Signor1
Copy link
Contributor Author

Signor1 commented Jan 7, 2026

Thanks a lot for this contribution!

It's always a pleasure!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use subscripts for small amounts

2 participants