Skip to content

[Due for payment 2025-04-08] [$250] Tax - After a digit, entering dot moves the first digit while adding tax rate #56951

Closed

Description

@lanitochka17

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: 9.0.99-0
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail: N/A
Issue reported by: Applause - Internal Team

Action Performed:

  1. Launch app
  2. Go to workspace settings - more features - enable tax
  3. Tap add rate - value
  4. Enter a digit eg: 3 and enter decimal point

Expected Result:

After a digit, entering dot must not move the first digit while adding tax rate

Actual Result:

After a digit, entering dot moves the first digit while adding tax rate

Workaround:

Unknown

Platforms:

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

  • Android: Standalone
  • Android: HybridApp
  • Android: mWeb Chrome
  • iOS: Standalone
  • iOS: HybridApp
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence
Bug6745800_1739803897453.Screenrecorder-2025-02-17-20-15-48-207.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021892375042404364604
  • Upwork Job ID: 1892375042404364604
  • Last Price Increase: 2025-03-06
  • Automatic offers:
    • huult | Contributor | 106508139
Issue OwnerCurrent Issue Owner: @twisterdotcom

Activity

  1. added
    Bug
    Daily
    on Feb 17, 2025
  2. melvin-bot commented on Feb 17, 2025

    @melvin-bot

    Triggered auto assignment to @twisterdotcom (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.

  3. added
    External
    on Feb 20, 2025
  4. changed the title [-]Tax - After a digit, entering dot moves the first digit while adding tax rate[/-] [+][$250] Tax - After a digit, entering dot moves the first digit while adding tax rate[/+] on Feb 20, 2025
  5. melvin-bot commented on Feb 20, 2025

    @melvin-bot
  6. added
    Help Wanted
    on Feb 20, 2025
  7. melvin-bot commented on Feb 20, 2025

    @melvin-bot

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

  8. D-01576 commented on Feb 20, 2025

    @D-01576

    🚨 Edited by proposal-police: This proposal was edited at 2025-02-20 07:20:09 UTC.

    Proposal

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

    Tax - After a digit, entering dot moves the first digit while adding tax rate

    What is the root cause of that problem?

    The regex required a digit after ., making 3. invalid.

    In src/libs/MoneyRequestUtils.ts

    • validateAmount used:

      (\\.\\d{0,${decimals}})?
    • ❌ This forced at least one digit after .

    • ❌ 3. was invalid → UI reset selection

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

    In src/libs/MoneyRequestUtils.ts

    Update this line in validateAmount:

    const regexString =
        decimals === 0
            ? `^${shouldAllowNegative ? '-?' : ''}\\d{1,${amountMaxLength}}$`
            : `^${shouldAllowNegative ? '-?' : ''}\\d{1,${amountMaxLength}}(\\.\\d{0,${decimals}})?$`;

    to this:

    const regexString =
        decimals === 0
            ? `^${shouldAllowNegative ? '-?' : ''}\\d{1,${amountMaxLength}}$`
            : `^${shouldAllowNegative ? '-?' : ''}\\d{1,${amountMaxLength}}(\\.?\\d{0,${decimals}})?$`;

    What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

    Input Expected Output Description
    3. ✅ Valid Allows a number followed by a decimal.
    3.5 ✅ Valid Allows a valid decimal number.
    3.55 (with decimals = 2) ✅ Valid Allows up to 2 decimal places.
    003.5 ✅ Valid Leading zeros are allowed.

    What alternative solutions did you explore? (Optional)

  9. github-actions commented on Feb 20, 2025

    @github-actions
    Contributor

    ⚠️ @D-01576 Thanks for your proposal. Please update it to follow the proposal template, as proposals are only reviewed if they follow that format (note the mandatory sections).

  10. eh2077 commented on Feb 20, 2025

    @eh2077
    Contributor

    @D-01576 Thanks for your proposal. But your root cause analysis is not clear to me. Can you elaborate please?

  11. 66 remaining items

  12. twisterdotcom commented on Apr 8, 2025

    @twisterdotcom
    Contributor

    Okay, are we saying this has basically caused another bug? If so, could we get @huult to fix it and hold #59607?

  13. huult commented on Apr 9, 2025

    @huult
    Contributor

    @twisterdotcom I will get back you soon

  14. huult commented on Apr 11, 2025

    @huult
    Contributor
  15. twisterdotcom commented on Apr 11, 2025

    @twisterdotcom
    Contributor

    Proposed plan here: #59607 (comment)

  16. twisterdotcom commented on Apr 14, 2025

    @twisterdotcom
    Contributor

    Waiting on resolution of the convo here. Looking like this will still be $250 though.

  17. twisterdotcom commented on Apr 15, 2025

    @twisterdotcom
    Contributor

    All good. Let's get this payment sorted now.

  18. twisterdotcom commented on Apr 15, 2025

    @twisterdotcom
    Contributor

    Payment Summary:

  19. moved this from Bugs and Follow Up Issues to Done in #expensify-bugson Apr 15, 2025
  20. JmillsExpensify commented on Apr 22, 2025

    @JmillsExpensify
    Contributor

    $250 approved for @eh2077

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

Metadata

Metadata

Labels

Awaiting PaymentBugDailyExternal

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions