-
Notifications
You must be signed in to change notification settings - Fork 9
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
663 + 664/ Fractional price display + handling no price data #674
Conversation
// For prices at least $0.0001, use normal formatting with min 2 and max 4 decimals. | ||
if (price >= 0.0001) { | ||
// Use BigDecimal for precise rounding. Scale to 4, rounding up. | ||
val bd = BigDecimal(price).setScale(4, RoundingMode.UP) |
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.
In scenarios involving monetary amounts, it is generally recommended to use RoundingMode.DOWN to prevent users from seeing an inflated amount. This helps avoid situations where users see an available balance that they actually cannot use.
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.
@JeffreyDoyle thoughts on the above? The logic in the issue suggests to round up, but agree this might be misleading to users.
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.
@jaymengxy discussed this during standup, agreed to round all the values down
Related Issue
Closes #663 and #664
Summary of Changes
Update token formatting logic to format values > 0 and < 0.01 according to the logic outlined in #663.
Also update to hide 0.00 and "-" prices/values, replacing with an empty string.
Example:


Need Regression Testing
Risk Assessment
Additional Notes
Screenshots (if applicable)