-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
Support for scientific notation when parsing coin amounts in ParseCoin #3662
Comments
@aspect not totally sure we want to further complicate the parsing of coins. It would be ideal, imho, that input to parsing coins would be of only one form and clients would have to perform an necessary conversion. In other words, you'd always provide e.g. 25atom as a client instead of 25000000uatom. /cc @rigelrozanski |
I'm more indifferent either way, however if the feature is clean/well-implemented/well-tested and doesn't seem to make the code base more confusing I don't see it as necessarily a bad addition - but agree in principle with what you're saying, we don't want to increase code complexity unnecessarily. The availability of this feature could reduce the possibility of typos errors in clients... I do think it's easier to read and confirm Either way, I'd recommend @aspect halt development (or risk of wasted effort) until some form consensus is reached in this issue's conversation |
@aspect dixit:
@alexanderbez dixit:
I very much agree with @alexanderbez here. The SDK should provide only primitives, therefore we should avoid introducing additional convenience parsers. They would come with the extra burden of maintaining different user input formats and their respective sanitization and validation functions. In other words, additional nice-to-haves introduce unnecessary security risks and are not worth their cost. |
I think there's enough consensus that this parsing should not be implemented on the SDK atm. I suggest implementing this on the client side instead. Closing this for now. |
Summary
Support for scientific notation such as
1.23e+6stake
when parsing coinsProblem Definition
When specifying coin amounts (especially during user input), it is extremely convenient to be able to use scientific notation such as
12.345e9
instead of1234000000
. This is especially useful when working with coins that have very large numerical values (i.e. 1mycoin == 1e12mysmallest).Proposal
Solution should support numbers such as
123e6
,1.23E+6
and reject1e-2
.For Admin Use
The text was updated successfully, but these errors were encountered: