Skip to content

[HOLD for payment 2023-09-27] [$500] Web - The amount of money is displayed inaccurately #27226

Closed

Description

@kbecciv

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Action Performed:

  1. In the workspace -> create a new request for money
  2. Click on Distance tab, choose the address for start and finish position -> press Next button
    3.. As you can the distance is 3.08 Km and the amount is $307,888.00

Expected Result:

With 3.08 km, the amount has to be $308,000 because I set up $100000 per km.

Actual Result:

The amount of money is displayed wrongly

Workaround:

Unknown

Platforms:

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

  • Android / native
  • Android / Chrome
  • iOS / native
  • iOS / Safari
  • MacOS / Chrome / Safari
  • MacOS / Desktop

Version Number: 1.3.65.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:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos: Any additional supporting documentation

Screenshot 2023-09-12 at 16 09 22

Screencast.from.07-09-2023.12_05_39.1.webm

Expensify/Expensify Issue URL:
Issue reported by: @thuyle04
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1694063085123039

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01789ec3d1fe468e8b
  • Upwork Job ID: 1701544874466258944
  • Last Price Increase: 2023-09-12
  • Automatic offers:
    • ahmedGaber93 | Contributor | 26643720

Activity

  1. ahmedGaber93 commented on Sep 12, 2023

    @ahmedGaber93
    Contributor

    Proposal

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

    The amount of money is displayed inaccurately

    What is the root cause of that problem?

    This because in merchant we display the roundedDistance but when calculating the amount we use Distance not rounding.

    const roundedDistance = convertedDistance.toFixed(2);

    const getDistanceRequestAmount = (distance, unit, rate) => {
    const convertedDistance = convertDistanceUnit(distance, unit);
    return convertedDistance * rate;
    };

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

    We need to use roundedDistance in getDistanceRequestAmount

    const getDistanceRequestAmount = (distance, unit, rate) => {
        const convertedDistance = convertDistanceUnit(distance, unit);
        const roundedDistance = convertedDistance.toFixed(2);
        return roundedDistance * rate;
    };

    What alternative solutions did you explore? (Optional)

    N/A

  2. DylanDylann commented on Sep 12, 2023

    @DylanDylann
    Contributor

    Proposal

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

    The amount of money is displayed inaccurately

    What is the root cause of that problem?

    In merchant field we are rounding the distance with 2 digits after the decimal point

    const roundedDistance = convertedDistance.toFixed(2);

    But when calculating the amount field we are using the correct distance

    const getDistanceRequestAmount = (distance, unit, rate) => {
    const convertedDistance = convertDistanceUnit(distance, unit);
    return convertedDistance * rate;
    };

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

    We also should round distance before calculating the amount field like this

        const convertedDistance = convertDistanceUnit(distance, unit).toFixed(2);
    

    Result

    Screenshot 2023-09-12 at 16 18 25

    What alternative solutions did you explore? (Optional)

    We will not round the distance in both places (merchant field and calculating amount field)
    With this approach we should remove toFixed(2) here

    const roundedDistance = convertedDistance.toFixed(2);

  3. added
    ExternalAdded to denote the issue can be worked on by a contributor
    BugSomething is broken. Auto assigns a BugZero manager.
    on Sep 12, 2023
  4. melvin-bot commented on Sep 12, 2023

    @melvin-bot
  5. changed the title [-]Web - The amount of money is displayed inaccurately[/-] [+][$500] Web - The amount of money is displayed inaccurately[/+] on Sep 12, 2023
  6. melvin-bot commented on Sep 12, 2023

    @melvin-bot

    Triggered auto assignment to @jliexpensify (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

  7. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Sep 12, 2023
  8. melvin-bot commented on Sep 12, 2023

    @melvin-bot

    Bug0 Triage Checklist (Main S/O)

    • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
    • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
      • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
    • This bug is reproducible using the reproduction steps in the OP. S/O
      • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
      • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
    • This issue is filled out as thoroughly and clearly as possible
      • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
    • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync
  9. melvin-bot commented on Sep 12, 2023

    @melvin-bot

    Triggered auto assignment to @sakluger (External), see https://stackoverflow.com/c/expensify/questions/8582 for more details.

  10. melvin-bot commented on Sep 12, 2023

    @melvin-bot

    Triggered auto assignment to Contributor-plus team member for initial proposal review - @mananjadhav (External)

  11. 26 remaining items

  12. jliexpensify commented on Sep 25, 2023

    @jliexpensify
    Contributor

    Payment Summary:

    • Bug Reporter: thuyle04 $50 - can you please add your full name to your GH profile (so we can find you in the future), and also apply for the job? Thanks!

    • Contributor: @ahmedGaber93 $500 + $250 (speed bonus)

    • C+: @mananjadhav $500 + $250 (speed bonus) - request on New.Dot

    Upwork job

  13. jliexpensify commented on Sep 25, 2023

    @jliexpensify
    Contributor

    Bump for @mananjadhav to also complete the checklist, thanks!

  14. jliexpensify commented on Sep 27, 2023

    @jliexpensify
    Contributor

    Bump on checklist @mananjadhav - payments occurring tomorrow!

  15. jliexpensify commented on Sep 28, 2023

    @jliexpensify
    Contributor

    Bump @mananjadhav to complete the checklist

  16. Julesssss commented on Oct 2, 2023

    @Julesssss
    Contributor

    Hey @mananjadhav, please complete the checklist here, or let us know if you are unavailable.

  17. mananjadhav commented on Oct 2, 2023

    @mananjadhav
    Collaborator

    This was caused by this commit and in this PR. I think we were shipping fast on the Distance request feature and hence this got missed out.

    I don't think we need a regression test here.

  18. jliexpensify commented on Oct 3, 2023

    @jliexpensify
    Contributor

    Whoops sorry, I was OOO:

  19. jliexpensify commented on Oct 3, 2023

    @jliexpensify
    Contributor

    Paid Thuy, job closed - thanks!

  20. JmillsExpensify commented on Oct 5, 2023

    @JmillsExpensify
    Contributor

    $750 payment approved for @mananjadhav based on BZ summary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions