fast
fast copied to clipboard
Fix: Exponential Notation in NumberField
The number field cautiously accepts multiple instances of "e," whereas the number system only permits a single occurrence of the same.
🎫 Issues
📑 Test Plan
11e1111 -> 11e1111 11e+1111 -> 11e+1111 11e-1111 -> 11e-1111 11e11.11 -> 11e1111 11e+11.11 -> 11e+1111 11e-11.11 -> 11e-1111 11e11e -> 11e11 11e111e1e1e1e1e1 -> 11e11111111 e -> empty 11e -> 11 e11 -> 0e11
✅ Checklist
General
- [ ] I have included a change request file using
$ yarn change
- [X] I have added tests for my changes.
- [X] I have tested my changes.
- [ ] I have updated the project documentation to reflect my changes.
- [ ] I have read the CONTRIBUTING documentation and followed the standards for this project.
Component-specific
- [ ] I have added a new component
- [X] I have modified an existing component
- [ ] I have updated the definition file
- [ ] I have updated the configuration file
I'd like to see a solution that allows for typing an exponential number as well - this only allows for programmatic insertion or copy-pasting into the field.
@rad
I'd like to see a solution that allows for typing an exponential number as well - this only allows for programmatic insertion or copy-pasting into the field.
Updated, can you please review it.
Unfortunately, as part of #6951 we are closing out all outstanding foundation PRs and I believe this one was on hold due to the potential issues with using regex in this situation so it will be closed for now, I would suggest creating a custom element with this capability.