Skip to content

js: Revert truncation of scaled ui amount - #1481

Merged
joncinque merged 2 commits into
solana-program:mainfrom
joncinque:revert-trunc-js
Sep 21, 2026
Merged

joncinque merged 2 commits into
solana-program:mainfrom
joncinque:revert-trunc-js

Conversation

@joncinque

Copy link
Copy Markdown
Contributor

Problem

As discussed in #1480, the scaled ui amount was updated in the program and the JS clients, but that PR only affects the program.

Summary of changes

Update the JS clients to truncate once again.

@cfkelly18 can you take a look?

#### Problem

As discussed in solana-program#1480, the scaled ui amount was updated in the program
and the JS clients, but that PR only affects the program.

#### Summary of changes

Update the JS clients to truncate once again.
@cfkelly18

Copy link
Copy Markdown

Looks good

One nit: this also reverts the formatUiAmountString part of #1345, so .toString() is back and small values render as 1e-9 where the program gives 0.000000001 (the 'inf' → 'Infinity' test flip is the same thing).

@joncinque

Copy link
Copy Markdown
Contributor Author

Ah right, thanks, went back to using formatUiAmountString

@cfkelly18 cfkelly18 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM now!

@joncinque
joncinque merged commit 6feb0eb into solana-program:main Sep 21, 2026
45 checks passed
@joncinque
joncinque deleted the revert-trunc-js branch September 21, 2026 16:23
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.

2 participants