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

Distance - Rate on confirmation page shows 3 decimal value for a 4-digit decimal value rate #49929

Open
6 tasks done
lanitochka17 opened this issue Sep 30, 2024 · 4 comments
Open
6 tasks done
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2

Comments

@lanitochka17
Copy link

lanitochka17 commented Sep 30, 2024

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Version Number: 9.0.41-2
Reproducible in staging?: Y
Reproducible in production?: Y
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): [email protected]
Issue reported by: Applause - Internal Team

Action Performed:

  1. Go to staging.new.expensify.com
  2. Go to workspace settings > Distance rates
  3. Click on any distance rate
  4. Change the distance rate to 4-digit decimal value (non-zero) and save it
  5. Go to workspace chat
  6. Click + > Submit expense > Distance
  7. Enter waypoints and proceed to confirmation page
  8. Click Rate
  9. Select the 4-digit decimal value rate in Step 4
  10. Note that the rate list only shows 3 decimal value instead of 4
  11. Submit the distance expense
  12. Go to transaction thread and open the receipt
  13. Note that the expense preview and distance receipt shows the complete rate which is 4-digit decimal value

Expected Result:

In Step 10, the rate list should show the complete decimal value (eg, 1.2345)

Actual Result:

In Step 10, the rate list only shows 3 decimal value (eg, 1.234)
In Step 13, the expense preview and distance receipt shows 4 decimal value which is the complete rate (eg, 1.2345)
The rate format is not consistent in the rate list and distance receipt

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence

Bug6618594_1727539618646.20240929_000027.mp4

View all open jobs on GitHub

@lanitochka17 lanitochka17 added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Sep 30, 2024
Copy link

melvin-bot bot commented Sep 30, 2024

Triggered auto assignment to @kadiealexander (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

@lanitochka17
Copy link
Author

@kadiealexander FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors

@NJ-2020
Copy link
Contributor

NJ-2020 commented Sep 30, 2024

Proposal

Please re-state the problem that we are trying to solve in this issue.

Distance - Rate on confirmation page shows 3 decimal value for a 4-digit decimal value rate

What is the root cause of that problem?

Right here the Rate Decimal for displaying Rate is 3 which is wrong

App/src/CONST.ts

Line 2402 in 0e3b82c

RATE_DECIMALS: 3,

And same here
const fixedDecimalPoints = decimalPart.length > 2 && !decimalPart.endsWith('0') ? 3 : 2;

What changes do you think we should make in order to solve the problem?

We should change it to 4

Result

Screen.Recording.2024-09-30.at.07.00.01.mov

What alternative solutions did you explore? (Optional)

@abzokhattab
Copy link
Contributor

i think this is caused by this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2
Projects
None yet
Development

No branches or pull requests

4 participants