-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
math/unsigned: permit _ separators in Uint128 decimal strings #21461
Conversation
May be we need to optimize code like |
I was following the precedent set in the line following my code addition where |
I wasn't sure if it was appropriate to compare a rune with a u8. Looks like it is. |
Yes, it is somewhat not pure (from a language perspective), but it makes code like this more compact and readable. Rune literals boil down to u8 values, when used in comparison to known u8 values. |
Permit '_' separator characters in strings that can be converted to Uint128 values.
This is like the other string -> numeric value conversions for the builtin number types.
I was thinking of doing the same for Uint256 if this change is acceptable for Uint128.