-
Notifications
You must be signed in to change notification settings - Fork 37
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 fractional durations #34
Comments
In the general case, It's unclear what precision of that should be. Is it all the way to nanoseconds? |
For my use case, that would be unnecessary (seconds are enough). |
Well, but this should be configurable then, and it's a big piece of code in this case. We probably have to do So I'm not sure if I want to open this can of worms. |
Exponential notation would be too much, I think. Just parsing a simple float ( |
Agreed that support for float durations would be really nice (I want to be able to parse I do understand not wanting to open this can of worms -- floats are tricky and this could add a lot of complexity. At the same time, I think @schneiderfelipe is right that even the most naive implementation would be very useful. If this feature isn't added, we should improve the error message to clarify that decimals aren't allowed. |
It would be nice to have
1.5 hour
parsed the same way1 hour 30 min
is.EDIT: the error is currently
duration::Error::InvalidCharacter(1)
.The text was updated successfully, but these errors were encountered: