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: Amount input correctly handles numbers and dots #481
Conversation
packages/shared/lib/units.ts
Outdated
return "0"; | ||
} | ||
if (!UNIT_MAP[fromUnit]) { | ||
throw new Error(`Unrecognized fromUnit ${fromUnit}`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we not need to catch these?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean they are never going to fire, but still, seems odd to leave them uncaught.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just pulled this method from my iota.js lib which already did the necessary conversion.
1509ff1
to
6046374
Compare
Description of change
The amount input now handles input correctly.
Input control now has integer and float support, not just numeric.
Scientific notation is handled correctly.
Additional focus visuals added.
Autofocus on send page.
Defaults to empty.
Links to any relevant issues
Fixes #473
Type of change
Choose a type of change, and delete any options that are not relevant.
How the change has been tested
Tested on windows.
Change checklist
Add an
x
to the boxes that are relevant to your changes, and delete any items that are not.