-
Notifications
You must be signed in to change notification settings - Fork 966
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
[BUG] Timespan Humanize MinUnit does not match documentation #873
Comments
I'll take this one :) |
Okay so it looks like the precision is the problem. The default precision for the Humanize call is 1, which then removes the rest of the data, in this case "2 seconds". If you make the call with |
precision will not work the same way. I want to have minimum unit set, not precision. With precision=2 the second test case will return |
Sorry, let me clarify. I was just giving an example of how a workaround would be possible by specifying the desired precision. I'll still work on a fix but I can't provide an ETA currently. |
I see, well in this case I'll have to figure out myself which precision to use based on the value of timestamp. Thanks for your help though. |
The documentation says:
When you run it on latest version you get different actual result:
TimeSpan.FromMilliseconds(122500).Humanize(minUnit: Humanizer.Localisation.TimeUnit.Second) => "2 minutes"
The text was updated successfully, but these errors were encountered: