-
Notifications
You must be signed in to change notification settings - Fork 3.9k
fix: IOU - On entering amount with decimals, 3rd decimal 0 is added in IOU confirmation page. #44416
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
Merged
thienlnam
merged 6 commits into
Expensify:main
from
Krishna2323:krishna2323/issue/43945
Jul 10, 2024
Merged
fix: IOU - On entering amount with decimals, 3rd decimal 0 is added in IOU confirmation page. #44416
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
98ebb2b
fix: IOU - On entering amount with decimals, 3rd decimal 0 is added i…
Krishna2323 d8054b9
fix for android native.
Krishna2323 96d38de
fix for android native.
Krishna2323 5c09225
Merge branch 'Expensify:main' into krishna2323/issue/43945
Krishna2323 189c3a3
Merge branch 'Expensify:main' into krishna2323/issue/43945
Krishna2323 0747007
fix tests.
Krishna2323 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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.
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.
@rayane-djouah, we also need to set
minimumFractionDigits, passingmaximumFractionDigitswithoutminimumFractionDigitscrashes the app on android native. I believe we can simply usegetCurrencyDecimals(currency),since it returns the correct value for currencies and the max is 2.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.
Hmm, test is failing, I will check for other solutions tomorrow.
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.
Is there any reason for the crash on Android native? What error are you getting?
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.
@rayane-djouah, no error is shown, the app just closes without providing
minimumFractionDigits.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.
Can you try to see in Android studios Logcat what error causes the app to crash?
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.
@rayane-djouah, sorry for delay, I tried but couldn't find
Android studios Logcat, I haven't used it till now, can you pls tell me where I can find it?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.
https://developer.android.com/studio/debug/logcat
https://developer.android.com/studio/debug/stacktraces
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 tried debugging the crash, but I saw no error.
Looks like this was faced before here: #43128 (comment)
Based on https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#minimumfractiondigits :
So it has the same behavior as
getCurrencyDecimals👍 We should be safe to use it instead ofundefined