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

fix(input-amount): parse amount always on locale once the amount is … #2439

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

gerjanvangeest
Copy link
Member

…formatted

What I did

  1. Make the parser always parse based on locale, if the value is a preformatted value.

Todo

  • Test edge cases
  • Add tests
  • Add changeset

Copy link

changeset-bot bot commented Jan 7, 2025

⚠️ No Changeset found

Latest commit: 80acacf

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@gerjanvangeest gerjanvangeest force-pushed the fix/parse-number-preformatted branch from e4939af to 9cded9e Compare January 7, 2025 14:13
@gerjanvangeest gerjanvangeest force-pushed the fix/parse-number-preformatted branch from 9cded9e to 80acacf Compare January 7, 2025 14:48
@ryubro
Copy link
Contributor

ryubro commented Jan 8, 2025

Thank you!! I think this could be definitely one of the solutions.

I have one edge cases in mind:

  • User is in the locale where the decimal separator is , but he is familar with using . as the separator (because that's the default behaviour of excel and firefox), editing existing value in large (like removing all the value or leaving only one or two) would be confusing
    • ex: user enters 99.99 and blurs the field so that the value was formatted to 99,99, then he removes everything other than 9 and edits to 9.45. It would be 945 instead of 9.45

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants