Skip to main content
Version: 3.0.8

Humanizer.TimeUnitToSymbolExtensions

TimeUnitToSymbolExtensions Class

Transform a time unit into a symbol; e.g. Year => "a"

public static class TimeUnitToSymbolExtensions

Inheritance System.Object → TimeUnitToSymbolExtensions

Methods

TimeUnitToSymbolExtensions.ToSymbol(this TimeUnit, CultureInfo) Method

TimeUnit.Day.ToSymbol() -> "d"

public static string ToSymbol(this Humanizer.TimeUnit unit, System.Globalization.CultureInfo? culture=null);

Parameters

unit TimeUnit

Unit of time to be turned to a symbol

culture System.Globalization.CultureInfo

Culture to use. If null, current thread's UI culture is used.

Returns

System.String