/// <summary>Gets the string representation.</summary> /// <param name="format">The format string.</param> /// <param name="provider">The format provider.</param> /// <returns>The string equivalent.</returns> public string ToString(string format, IFormatProvider provider) { return(ByteSizeFormat.Format(format, this, provider)); }
/// <summary>Gets the string representation.</summary> /// <param name="provider">The format provider.</param> /// <returns>The string equivalent.</returns> public string ToString(IFormatProvider provider) { return(ByteSizeFormat.Format(ByteSizeFormat.DefaultFormatString, this, provider)); }
/// <summary>Gets the string representation.</summary> /// <param name="format">The format string.</param> /// <returns>The string equivalent.</returns> /// <remarks> /// The supported format strings are listed below. /// <list type="table"> /// <item> /// <term>Specifier</term> /// <description>Description</description> /// </item> /// <item> /// <term>b, k, m, g, or t (case insensitive)</term> /// <description>Displays the value in the given unit as a whole integer.</description> /// </item> /// <item> /// <term>bb, kk, mm, gg or tt (case insensitive)</term> /// <description>Displays the value in the given unit as a fixed point decimal with 1 digit of precision.</description> /// </item> /// <item> /// <term>bbb, kkk, mmm, ggg or ttt (case insensitive)</term> /// <description>Displays the value in the given unit as a fixed point decimal with 2 digits of precision.</description> /// </item> /// <item> /// <term>f or F</term> /// <description>Displays the value using the best unit as a whole number.</description> /// </item> /// <item> /// <term>ff or FF</term> /// <description>Displays the value using the best unit as a fixed point decimal with 1 digit of precision.</description> /// </item> /// <item> /// <term>fff or FFF</term> /// <description>Displays the value using the best unit as a fixed point decimal with 2 digits of precision.</description> /// </item> /// <item> /// <term>u and U</term> /// <description>Displays the best unit as a lower or uppercase single letter (b, k, etc).</description> /// </item> /// <item> /// <term>uu and UU</term> /// <description>Displays the best unit as a lower or uppercase abbreviation (by, kb, etc).</description> /// </item> /// <item> /// <term>uuu and UUU</term> /// <description>Displays the best unit as a lower or uppercase word (bytes, kilobytes, etc).</description> /// </item> /// </list> /// </remarks> public string ToString(string format) { return(ByteSizeFormat.Format(format, this, null)); }
/// <summary>Gets the string representation.</summary> /// <returns>The string equivalent.</returns> /// <remarks> /// The format string is: ",fff UU" /// </remarks> public override string ToString() { return(ByteSizeFormat.Format(ByteSizeFormat.DefaultFormatString, this, null)); }
/// <summary>Gets the value formatted as a short string.</summary> /// <returns>The string equivalent.</returns> /// <remarks> /// The short string uses the format string: ",f UU" /// </remarks> public string ToShortString() { return(ByteSizeFormat.Format(",f UU", this, null)); }
/// <summary>Gets the value formatted as a long string.</summary> /// <returns>The string equivalent.</returns> /// <remarks> /// The long string uses the format string: ",fff UUU" /// </remarks> public string ToLongString() { return(ByteSizeFormat.Format(",fff UUU", this, null)); }