Skip to main content
Version: 3.0.8

Humanizer.HeadingExtensions

HeadingExtensions Class

Contains extensions to transform a number indicating a heading into the textual representation of the heading.

public static class HeadingExtensions

Inheritance System.Object → HeadingExtensions

Methods

HeadingExtensions.FromAbbreviatedHeading(this string) Method

Returns a heading based on the short textual representation of the heading.

public static double FromAbbreviatedHeading(this string heading);

Parameters

heading System.String

The short textual representation of a heading

Returns

System.Double
The heading. -1 if the heading could not be parsed.

HeadingExtensions.FromAbbreviatedHeading(this string, CultureInfo) Method

Returns a heading based on the short textual representation of the heading.

public static double FromAbbreviatedHeading(this string heading, System.Globalization.CultureInfo? culture=null);

Parameters

heading System.String

The short textual representation of a heading

culture System.Globalization.CultureInfo

The culture of the heading

Returns

System.Double
The heading. -1 if the heading could not be parsed.

HeadingExtensions.FromHeadingArrow(this char) Method

Returns a heading based on the heading arrow.

public static double FromHeadingArrow(this char heading);

Parameters

heading System.Char

Returns

System.Double

HeadingExtensions.FromHeadingArrow(this string) Method

Returns a heading based on the heading arrow.

public static double FromHeadingArrow(this string heading);

Parameters

heading System.String

Returns

System.Double

HeadingExtensions.ToHeading(this double, HeadingStyle, CultureInfo) Method

Returns a textual representation of the heading.

This representation has a maximum deviation of 11.25 degrees.

public static string ToHeading(this double heading, Humanizer.HeadingStyle style=Humanizer.HeadingStyle.Abbreviated, System.Globalization.CultureInfo? culture=null);

Parameters

heading System.Double

The heading value

style HeadingStyle

Whether to return a short result or not. HeadingStyle

culture System.Globalization.CultureInfo

The culture to return the textual representation in

Returns

System.String
A textual representation of the heading

HeadingExtensions.ToHeadingArrow(this double) Method

Returns a char arrow indicating the heading.

This representation has a maximum deviation of 22.5 degrees.

public static char ToHeadingArrow(this double heading);

Parameters

heading System.Double

Returns

System.Char
The heading arrow.