-
Notifications
You must be signed in to change notification settings - Fork 987
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
fix(swap): round values for very small values in fiat and crypto #21442
Conversation
Jenkins BuildsClick to see older builds (14)
|
227360e
to
7ff75fc
Compare
(let [number (or (money/bignumber amount) | ||
(money/bignumber 0)) | ||
amount-fixed-decimals (number/to-fixed number display-decimals)] | ||
(if (and (= amount-fixed-decimals "0") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why "0"
and not 0
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's because number/to-fixed
calls remove-trailing-zeroes
fn which returns a string
@@ -26,6 +26,7 @@ | |||
[utils.string :as utils.string])) | |||
|
|||
(def ^:private default-text-for-unfocused-input "0.00") | |||
(def ^:private default-token-symbol "ETH") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we don't have this constant somewhere already
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved but added two small comments
7ff75fc
to
369a375
Compare
75% of end-end tests have passed
Failed tests (2)Click to expandClass TestCommunityMultipleDeviceMerged:
Class TestWalletOneDevice:
Passed tests (6)Click to expandClass TestCommunityOneDeviceMerged:
Class TestOneToOneChatMultipleSharedDevicesNewUi:
Class TestWalletMultipleDevice:
Class TestWalletOneDevice:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@briansztamfater Thank you for your PR. You can go ahead and merge this PR. |
Signed-off-by: Brian Sztamfater <[email protected]>
369a375
to
d0f2db0
Compare
fixes #21415
fixes #21419
Summary
This PR fixes fiat values shown as 0 when the value is less than 0.01, and also the same for crypto tokens when the value is less than 0.000001. Also fixes an error when long-tapping on an asset from the wallet main page and selecting "Swap".
Platforms
Areas that maybe impacted
Functional
Steps to test
Issue #21415
Issue #21419
status: ready