Humanizr / Humanizer

Humanizer meets all your .NET needs for manipulating and displaying strings, enums, dates, times, timespans, numbers and quantities

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to show smaller than milliseconds for TimeSpan?

lloydjatkinson opened this issue · comments

I need to display microseconds from a TimeSpan, however right now all I'm able to get is "0 milliseconds".

timeSpan.Humanize(culture: culture);

Does Humanizer support displaying them?

try using the precision override

public static string Humanize(this TimeSpan timeSpan, int precision, bool countEmptyUnits, CultureInfo? culture = null, TimeUnit maxUnit = TimeUnit.Week, TimeUnit minUnit = TimeUnit.Millisecond, string? collectionSeparator = ", ", bool toWords = false)
    {