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

🐛 NumberBox format function breaks it if num.tryParse can not parse the text #1166

Open
HarsimranVirk opened this issue Jan 14, 2025 · 2 comments
Labels
invalid This doesn't seem right

Comments

@HarsimranVirk
Copy link

Describe the bug
NumberBox format function fails if we add commas or $ in the formatted text. Something like $200,000 will break the widget and it will not change state anymore.

To Reproduce
Steps to reproduce the behavior:
Use NumberFormat.currency().format as the format function, NumberBox will be broken.

Expected behavior
If users are given the option to have any arbitrary format function, then the assumption that num.tryParse() will be able to parse the formatted text back to a num value is incorrect.

@HarsimranVirk
Copy link
Author

We can add an additional reverseFormat function to let users define how to parse their formatted text back to a num value

@HarsimranVirk HarsimranVirk changed the title 🐛 NumberBox format funtion breaks functionality if num.tryParse can not parse the text 🐛 NumberBox format function breaks it if num.tryParse can not parse the text Jan 14, 2025
@bdlukaa
Copy link
Owner

bdlukaa commented Jan 20, 2025

This behavior is not encountered in the Native implementation.

@bdlukaa bdlukaa added the invalid This doesn't seem right label Jan 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

2 participants