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

Package should not throw errors when thousandSeparator and decimalSeparator are similar #831

Open
ralucaStan opened this issue Mar 28, 2024 · 0 comments

Comments

@ralucaStan
Copy link

ralucaStan commented Mar 28, 2024

Describe the issue and the actual behavior

When thousandSeparator and decimalSeparator are similar, the plugin throws an Error.

Describe the expected behavior

Although those separators should not be identical I don't think react-number-format should throw an error.
IMO it should show an warning informing the developers and it should still render some output; Informing developers allows them to see and fix the issue upstream. Renderign a value would enable consumers of the plugin to not provide a broken experience.
Throwing an error is impacting flows on real websites. Imagine a checkout flow interrupted by a formatting plugin.

Provide a CodeSandbox link illustrating the issue

Not needed

<NumberFormat
  thousandSeparator="."
  decimalSeparator="."
  ... 
  />

Nice to have

Communicate this limitation in the docs

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

No branches or pull requests

1 participant