Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix documentation for UInt128/Int128.ToString
  • Loading branch information
dakersnar committed Sep 19, 2022
commit f18cfa7ee95cea427b72e8da15e6af91da8b0391
14 changes: 14 additions & 0 deletions src/libraries/System.Private.CoreLib/src/System/Int128.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,16 +98,30 @@ public override string ToString()
return Number.Int128ToDecStr(this);
}

/// <param name="provider">An object that supplies culture-specific formatting information.</param>
/// <summary>Converts the numeric value of this instance to its equivalent string representation using the specified culture-specific format information.</summary>
/// <returns>The string representation of the value of this instance as specified by <paramref name="provider" />.</returns>
public string ToString(IFormatProvider? provider)
{
return Number.FormatInt128(this, null, provider);
}

/// <param name="format">The format to use.
/// -or-
/// A <see langword="null" /> reference (<see langword="Nothing" /> in Visual Basic) to use the default format defined for the type of the <see cref="T:System.IFormattable" /> implementation.</param>
/// <summary>Converts the numeric value of this instance to its equivalent string representation, using the specified format.</summary>
/// <returns>The string representation of the value of this instance as specified by <paramref name="format" />.</returns>
public string ToString([StringSyntax(StringSyntaxAttribute.NumericFormat)] string? format)
{
return Number.FormatInt128(this, format, null);
}

/// <param name="format">The format to use.
/// -or-
/// A <see langword="null" /> reference (<see langword="Nothing" /> in Visual Basic) to use the default format defined for the type of the <see cref="T:System.IFormattable" /> implementation.</param>
/// <param name="provider">An object that supplies culture-specific formatting information.</param>
/// <summary>Formats the value of the current instance using the specified format.</summary>
/// <returns>The value of the current instance in the specified format.</returns>
public string ToString([StringSyntax(StringSyntaxAttribute.NumericFormat)] string? format, IFormatProvider? provider)
{
return Number.FormatInt128(this, format, provider);
Expand Down
14 changes: 14 additions & 0 deletions src/libraries/System.Private.CoreLib/src/System/UInt128.cs
Original file line number Diff line number Diff line change
Expand Up @@ -99,16 +99,30 @@ public override string ToString()
return Number.UInt128ToDecStr(this);
}

/// <param name="provider">An object that supplies culture-specific formatting information.</param>
/// <summary>Converts the numeric value of this instance to its equivalent string representation using the specified culture-specific format information.</summary>
/// <returns>The string representation of the value of this instance as specified by <paramref name="provider" />.</returns>
public string ToString(IFormatProvider? provider)
{
return Number.FormatUInt128(this, null, provider);
}

/// <param name="format">The format to use.
/// -or-
/// A <see langword="null" /> reference (<see langword="Nothing" /> in Visual Basic) to use the default format defined for the type of the <see cref="T:System.IFormattable" /> implementation.</param>
/// <summary>Converts the numeric value of this instance to its equivalent string representation, using the specified format.</summary>
/// <returns>The string representation of the value of this instance as specified by <paramref name="format" />.</returns>
public string ToString([StringSyntax(StringSyntaxAttribute.NumericFormat)] string? format)
{
return Number.FormatUInt128(this, format, null);
}

/// <param name="format">The format to use.
/// -or-
/// A <see langword="null" /> reference (<see langword="Nothing" /> in Visual Basic) to use the default format defined for the type of the <see cref="T:System.IFormattable" /> implementation.</param>
/// <param name="provider">An object that supplies culture-specific formatting information.</param>
/// <summary>Formats the value of the current instance using the specified format.</summary>
/// <returns>The value of the current instance in the specified format.</returns>
public string ToString([StringSyntax(StringSyntaxAttribute.NumericFormat)] string? format, IFormatProvider? provider)
{
return Number.FormatUInt128(this, format, provider);
Expand Down