-
Notifications
You must be signed in to change notification settings - Fork 3k
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
[HOLD for payment 2024-04-05] [HOLD for payment 2024-04-03] [Simplified Collect][Taxes] Value row shows decimal point with no digit when saving amount with a dot and with no digit after #38499
Comments
Triggered auto assignment to @sonialiap ( |
👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
|
Triggered auto assignment to @chiragsalian ( |
ProposalPlease re-state the problem that we are trying to solve in this issue.Value row shows decimal point with no digit when saving amount with a decimal and with no digit after. What is the root cause of that problem?There's no logic to remove the decimal if there's no value after it. If the currency supports decimals, then inputs like App/src/components/AmountForm.tsx Lines 97 to 115 in e4aff64
What changes do you think we should make in order to solve the problem?Add logic to remove the decimal if there's nothing after it. let strippedAmount = MoneyRequestUtils.stripCommaFromAmount(newAmountWithoutSpaces);
+ // Remove the decimal if there's no value after it
+ if (strippedAmount.endsWith('.')) {
+ strippedAmount = strippedAmount.slice(0, -1);
+ } |
ProposalPlease re-state the problem that we are trying to solve in this issue.What is the root cause of that problem?In App/src/components/AmountForm.tsx Line 109 in ed6fbbc
What changes do you think we should make in order to solve the problem?We need to create a new Here we have two options:
function stripDecimalPointIfNoDigitsAfter(amount: string): string {
return amount.replace(/(\.\d*?)0*$/, '$1');
}
function addZeroAfterDecimalIfNeeded(amount: string): string {
return amount.replace(/(\.\d*)$/, '$10');
} I would prefer option 2 more :), but okay with implementation of option 1 as well |
ProposalPlease re-state the problem that we are trying to solve in this issue.Value row shows decimal point with no digit when saving amount with a dot and with no digit after What is the root cause of that problem?we display and send to backend what user type in amount field without clean it. What changes do you think we should make in order to solve the problem?we can add App/src/libs/actions/TaxRate.ts Lines 15 to 17 in ed6fbbc
and this method is used in the title and before send tax to backend What alternative solutions did you explore? (Optional) |
This was introduced here. This is NAB since this feature is only available on Collect policies in NewDot and users don't have access to that yet. I think we can address that as a follow up to the other tax PRs. cc @kosmydel @filip-solecki |
@luacmartins @chiragsalian Any chances of making this external? |
I leave it to @luacmartins since i belive he's working on this feature. Also @ShridharGoel, i think your proposal might be incorrect since it will block a user from entering a decimal unless they click on the left arrow to go somewhere in between a number and then enter a decimal which is not the best user experience. |
Hey, I am the author of the original PR and I will take care of this one. Can the value rates be decimal? If so, how many decimal places should we show? |
Thanks for taking this on @kosmydel! It seems like OldDot accepts 16 decimals 😅 @trjExpensify can you confirm if we should keep the same behavior? |
Confirmed internally that we should support up to 16 decimals! |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.56-8 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue: If no regressions arise, payment will be issued on 2024-04-03. 🎊 For reference, here are some details about the assignees on this issue:
|
BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
|
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.57-5 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue: If no regressions arise, payment will be issued on 2024-04-05. 🎊 For reference, here are some details about the assignees on this issue:
|
BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
|
If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results. If a regression has occurred and you are the assigned CM follow the instructions here. If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future. |
@luacmartins did the linked PR cause a regression? |
This was a new feature and it was under development at the time, so no regressions |
Payment Summary
BugZero Checklist (@sonialiap)
|
@shubham1206agra $500 - offer sent |
@shubham1206agra let me know if you didn't receive the offer on Upwork. If you have, it's ready for you to accept and be paid :D |
Shubham asked for payment to be delayed - slack |
Melvin, not overdue |
Paid |
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Version Number: 1.4.54-0
Reproducible in staging?: y
Reproducible in production?: new feature
If this was caught during regression testing, add the test name, ID and link from TestRail: n/a
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: applause internal team
Slack conversation:
Action Performed:
Precondition:
Expected Result:
The Value row will not display decimal since there is no value after the dot.
Actual Result:
The Value row shows decimal with no digit after it.
Workaround:
unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Add any screenshot/video evidence
Bug6418140_1710783219469.20240319_012920.mp4
View all open jobs on GitHub
The text was updated successfully, but these errors were encountered: