FormattableExtensions Class

Provides extension methods for IFormattable types to format values using the invariant culture.

public static class FormattableExtensions

Methods

NameDescription
ToStringInvariant<T>(T)Converts the value to its string representation using the invariant culture.
ToStringInvariant<T>(T, string?)Converts the value to its string representation using the invariant culture and the specified format.

ToStringInvariant overloads

ToStringInvariant<T>(T)

FormattableExtensions.cs

Converts the value to its string representation using the invariant culture.

public static string ToStringInvariant<T>(this T value) where T : IFormattable
Type parameters
T
Parameters
value T
Returns

string

ToStringInvariant<T>(T, string?)

FormattableExtensions.cs

Converts the value to its string representation using the invariant culture and the specified format.

public static string ToStringInvariant<T>(this T value, string? format) where T : IFormattable
Type parameters
T
Parameters
value T
format string?
Returns

string