-
Notifications
You must be signed in to change notification settings - Fork 71
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
FloatOption: Add support for scientific notation and + sign #250
FloatOption: Add support for scientific notation and + sign #250
Conversation
flavono123
commented
Jan 15, 2020
•
edited by olleolleolle
Loading
edited by olleolleolle
- parse the float with a prepended + sign
- parse scientific notations
- remove the todo comment
Signed-off-by: Hansuk <[email protected]>
- reference: https://stackoverflow.com/questions/638565/parsing-scientific-notation-sensibly - remove the todo comment(no idea for etc) Signed-off-by: Hansuk <[email protected]>
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.
This adds a useful feature for people who use the float option, without being in the way of those who don't.
It clearly removes a TODO item - by fixing it.
Thank you for taking the time to compose this clear and descriptive test as well.
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.
This is great, thanks @flavono123! I've added one comment but otherwise it's good to merge
- #250 (comment) - #250 (comment) Signed-off-by: Hansuk <[email protected]>
Thank you too for reviews on my commits and I admit your comments @leejarvis |
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.
Great work, thank you! 💙
Btw, for the style, how about add a lint(rubocop) and run in a travis build?
I do like the idea of adding a linter, through I'm not a fan of the Rubocop defaults so I'd likely need to spend a bit of time playing with it. Let's consider that in a separate PR.
Thanks again! I'll get a new version of Slop cut and release this
Update ruby-slop to 4.8.0. v4.8.0 (2020-01-17) ------------------- Features: * Add support for prefixing integer values with `+` character [#243](leejarvis/slop#243) (Juha Ylitalo) * Add support for parsing floats with scientific notation [#250](leejarvis/slop#250) (Hansuk Hong) Maintenance: * Add 2.7.0 to CI and fix warnings [#248](leejarvis/slop#248) (Juha Ylitalo, Andrew Kane)