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

[Bug]: Display second decimal on rounded total balances #13638

Closed
darkwing opened this issue Feb 20, 2025 · 0 comments · Fixed by #13818
Closed

[Bug]: Display second decimal on rounded total balances #13638

darkwing opened this issue Feb 20, 2025 · 0 comments · Fixed by #13818
Assignees
Labels
regression-prod-7.40 Regression bug that was found in production in release 7.40 release-7.43.0 Issue or pull request that will be included in release 7.43.0 Sev2-normal An issue that may lead to users misunderstanding some limited risks they are taking team-assets type-bug Something isn't working

Comments

@darkwing
Copy link
Contributor

Describe the bug

If a user fiat total is $42.50", the total will display in the aggregated balance as "$42.5". Fiat usually always displays at least two decimal places, so let's do that.

Expected behavior

No response

Screenshots/Recordings

Image

Steps to reproduce

  1. By luck have an aggregated balance with a rounded decimal number.

Error messages or log output

Detection stage

In production (default)

Version

7.40

Build type

None

Device

iPhone

Operating system

iOS

Additional context

No response

Severity

No response

@darkwing darkwing added Sev2-normal An issue that may lead to users misunderstanding some limited risks they are taking team-assets type-bug Something isn't working labels Feb 20, 2025
@github-project-automation github-project-automation bot moved this to To be fixed in Bugs by team Feb 20, 2025
@github-project-automation github-project-automation bot moved this to To be fixed in Bugs by severity Feb 20, 2025
@metamaskbot metamaskbot added the regression-prod-7.40 Regression bug that was found in production in release 7.40 label Feb 20, 2025
@gambinish gambinish self-assigned this Feb 20, 2025
github-merge-queue bot pushed a commit that referenced this issue Mar 6, 2025
## **Description**

On mobile, we've had a bug where if the aggregated balance of someone's
wallet was rounding to the tenths decimal place rather than the
hundredths.

If the balance in `10.1` the aggregated fiat balance should read `$10.00
USD` rather than `$10.1`

We are leveraging the `formatWithThreshold` utility, which we've been
using on extension for a while. I would like to begin integrating this
throughout both codebases, and hope to outline this plan in an ADR
shortly. It might be worth it to consolidate this function into core.

## **Related issues**

Fixes: #13638

## **Manual testing steps**

1. Go to this page...
2.
3.

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**


![rounding-bug](https://github.com/user-attachments/assets/11c30a51-5da0-4fcd-8391-ef09d4a4871b)

### **After**

<img width="443" alt="Screenshot 2025-03-04 at 10 39 38 AM"
src="https://github.com/user-attachments/assets/51dee15e-cbc3-4b03-8dca-b7a3651b2766"
/>

## **Pre-merge author checklist**

- [x] I’ve followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
@github-project-automation github-project-automation bot moved this from To be fixed to Fixed in Bugs by severity Mar 6, 2025
@metamaskbot metamaskbot added the release-7.43.0 Issue or pull request that will be included in release 7.43.0 label Mar 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
regression-prod-7.40 Regression bug that was found in production in release 7.40 release-7.43.0 Issue or pull request that will be included in release 7.43.0 Sev2-normal An issue that may lead to users misunderstanding some limited risks they are taking team-assets type-bug Something isn't working
Projects
Archived in project
Status: To be triaged
Development

Successfully merging a pull request may close this issue.

3 participants