-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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/ Zeros are added to currency that does not support decimal #43816
Fix/ Zeros are added to currency that does not support decimal #43816
Conversation
@shubham1206agra Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
@eVoloshchak @dangrous Please let me know what you think about these changes and if we need to change anything else |
Co-authored-by: Eugene Voloshchak <copyreading@gmail.com>
Reviewer Checklist
Screenshots/VideosAndroid: Native24-07-08-01-16-40.mp4Android: mWeb ChromeScreen.Recording.2024-07-08.at.01.19.55.moviOS: NativeScreen.Recording.2024-07-08.at.01.15.18.moviOS: mWeb SafariScreen.Recording.2024-07-08.at.01.13.20.movMacOS: Chrome / SafariScreen.Recording.2024-07-08.at.01.12.35.movMacOS: DesktopScreen.Recording.2024-07-08.at.01.16.04.mov |
How are we looking on this @abzokhattab - do you have any ideas on that iOS Safari issue? I'd like to get this closed out this week. |
Bump @abzokhattab - it's been a week - can we get an ETA on this please? We should be able to merge on Friday or earlier. Thanks. |
…ncy-with-some-currencies
Sorry for the late response ... i am checking this bug now |
This issue exists in the main branch so the current changes didn't introduce this bug .. this is another bug: Screen.Recording.2024-07-03.at.4.22.40.PM.movfrom my testing, i see that Intl.NumberFormat is not always consistent .. sometimes it adds the decimal zeros and others not. |
@shubham1206agra can you confirm that that particular bug already exists on |
This is actually being handled by @eVoloshchak, not me. |
oops sorry! @eVoloshchak same question - can you confirm that that particular bug already exists on main? If so we can move forward with this and report that separately (if it's the only remaining issue) |
Can confirm the issue is present on staging, moving forward with the checklist |
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!
We did not find an internal engineer to review this PR, trying to assign a random engineer to #43215 as well as to this PR... Please reach out for help on Slack if no one gets assigned! |
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.
Seems pretty simplified (great!) as long as it tests well. One note about params but then I think we should be good!
src/libs/CurrencyUtils.ts
Outdated
@@ -96,11 +96,11 @@ function convertToFrontendAmountAsInteger(amountAsInt: number): number { | |||
* | |||
* @note we do not support any currencies with more than two decimal places. | |||
*/ | |||
function convertToFrontendAmountAsString(amountAsInt: number | null | undefined): string { | |||
function convertToFrontendAmountAsString(amountAsInt: number | null | undefined, currency?: string): string { |
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.
currency
shouldn't be optional, right? Else L103 will break...
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.
Yeah we can make it as required.
Done
…dAmountAsString function
great, thanks! @eVoloshchak do you want to give this one final look and test? And make sure we updated any usages as necessary to include |
I'm late, apologies. @abzokhattab, could you resolve the conflicts please? |
bump @abzokhattab - can you please handle the conflicts (and @eVoloshchak the final test) so we can get this out today? |
Seems like most of the current changes were already done in this PR i resolved the conflicts |
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.
Okay sorry - now that the rest of the code is updated, and has the default value for currency, we no longer need this to be required. So it looks like the only actual change we need is adding shouldKeepUserInput
to IOURequestStepAmount
.
I'm curious - why is that other PR so similar to this one? Did they use your work?
Co-authored-by: Daniel Gale-Rosen <5487802+dangrous@users.noreply.github.com>
yeah, i enabled it to make the
I don't really know 😂 ... maybe a coincidence |
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.
looks fine!
@eVoloshchak if you want to give it last looks we should be all set! |
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.
Tests well!
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.
woohoo!
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
🚀 Deployed to staging by https://github.com/dangrous in version: 9.0.9-1 🚀
|
🚀 Cherry-picked to staging by https://github.com/mountiny in version: 9.0.9-2 🚀
@Expensify/applauseleads please QA this PR and check it off on the deploy checklist if it passes. |
🚀 Deployed to production by https://github.com/mountiny in version: 9.0.9-5 🚀
|
🚀 Deployed to production by https://github.com/mountiny in version: 9.0.10-7 🚀
|
Details
Fixed Issues
$ #43215
PROPOSAL:
Tests
MRO
).Offline tests
Same as Tests
QA Steps
Same as Tests
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label and/or tagged@Expensify/design
so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
Screen.Recording.2024-06-16.at.1.38.42.PM.mov
Android: mWeb Chrome
Screen.Recording.2024-06-16.at.2.06.03.PM.mov
iOS: Native
Screen.Recording.2024-06-16.at.1.38.42.PM.mov
iOS: mWeb Safari
Screen.Recording.2024-06-16.at.2.05.27.PM.mov
MacOS: Chrome / Safari
Screen.Recording.2024-06-16.at.1.29.16.PM.mov
MacOS: Desktop
Screen.Recording.2024-06-16.at.2.54.58.PM.mov