Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

token-2022: Take decimals into account for UI amount #7540

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

joncinque
Copy link
Contributor

Problem

The interest-bearing and scaled UI amount extensions don't take into account the mint decimals when printing the number, and they don't properly trim afterwards. This can be confusing.

Summary of changes

Update the UI amount conversion to take into account the decimals of precision, and then actually trim. Note that a lot of calculations become more precise because of this change!

#### Problem

The interest-bearing and scaled UI amount extensions don't take into
account the mint decimals when printing the number, and they don't
properly trim afterwards. This can be confusing.

#### Summary of changes

Update the UI amount conversion to take into account the decimals of
precision, and then actually trim. Note that a lot of calculations
become more precise because of this change!
Copy link

@gitteri gitteri left a comment

Choose a reason for hiding this comment

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

Nice!

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