fix: Prevent coercing small spending caps to zero#28179
Merged
pedronfigueiredo merged 1 commit intodevelopfrom Oct 30, 2024
Merged
fix: Prevent coercing small spending caps to zero#28179pedronfigueiredo merged 1 commit intodevelopfrom
pedronfigueiredo merged 1 commit intodevelopfrom
Conversation
Contributor
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
Collaborator
Builds ready [abd4de7]
Page Load Metrics (1913 ± 52 ms)
Bundle size diffs
|
abd4de7 to
db286c8
Compare
DDDDDanica
previously approved these changes
Oct 30, 2024
Contributor
There was a problem hiding this comment.
LGTM, Can we append a simple test?
Contributor
Author
There was a problem hiding this comment.
Good idea, I added one test.
db286c8 to
e0ea0b1
Compare
e0ea0b1 to
aa689a9
Compare
DDDDDanica
approved these changes
Oct 30, 2024
Contributor
|
LGTM ! |
Collaborator
Builds ready [aa689a9]
Page Load Metrics (1955 ± 52 ms)
Bundle size diffs
|
matthewwalsh0
approved these changes
Oct 30, 2024
Collaborator
|
Missing release label release-12.6.0 on PR. Adding release label release-12.6.0 on PR and removing other release labels(release-12.7.0), as PR was cherry-picked in branch 12.6.0. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Previously there was a bug that affected the approve screen. When users had a small spending cap (between 0.001 and 0.0001 or smaller), it was coerced to 0.
This was caused by the method
new Intl.NumberFormat(locale).format(spendingCap)that applied the1,000large number formatting, so the fix is to bypass it entirely for values smaller than 1.Additionally, these unformatted small numbers are presented in scientific notation, so we leverage
toNonScientificString(spendingCap)to prevent that.Related issues
Fixes: #28117
Manual testing steps
See original bug report.
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist