-
Notifications
You must be signed in to change notification settings - Fork 30
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
Arbitrary precision #3
Comments
This looks like a good idea. I just need to understand a little bit more what you have in mind. Could you explain in your example why ;
It does not looks coherent to me. Thank you |
Ah, so the For the first case, why FormatPrecise(60 * time.Second, time.Second) == "60 seconds"
FormatPrecise(60 * time.Second, time.Minute) == "1 minute"
FormatPrecise(60 * time.Second, time.Hour) == "less than an hour" As for the second case, That's a good question, and also technically satisfies what I mentioned, but I would argue this behaviour is less useful because:
The thing that timeago does nicely is help you create nice human-readable time output. The precision-oriented approach is more to tailor the towards relevant orders of magnitude. For example: In my application, it's meaningless to speak about a metric in the scope of "seconds". I never want to see "X minutes and Y seconds", so I would use Does that make sense? |
Any interest in adding support for arbitrary precision?
I imagine something like,
Or perhaps for the sake of cross-language grammar simplicity, just
3 hours 25 minutes 45 seconds
.Alternatively this could be part of Config.
The text was updated successfully, but these errors were encountered: