BigDecimal BigDecimal
BigDecimal BigDecimal
DocFX + Singulink = ♥

Search Results for

    Method ToString

    ToString()

    Returns a full-precision decimal form string representation of this value using the current culture.

    Declaration
    public override string ToString()
    Returns
    Type Description
    string
    Overrides
    ValueType.ToString()

    ToString(string?, IFormatProvider?)

    Returns a string representation of this value.

    Declaration
    public string ToString(string? format, IFormatProvider? formatProvider = null)
    Parameters
    Type Name Description
    string format

    The string format to use. The "G" format is used if none is provided.

    IFormatProvider formatProvider

    The format provider that will be used to obtain number format information. The current culture is used if none is provided.

    Returns
    Type Description
    string
    Implements
    IFormattable.ToString(string, IFormatProvider)
    Remarks

    String format is composed of a format specifier followed by an optional precision specifier.

    Format specifiers:

    SpecifierNameDescription
    "G"GeneralDefault format specifier if none is provided. Precision specifier determines the number of significant digits. If the precision specifier is omitted then the value is written out in full precision decimal form. If a precision specifier is provided then the value is rounded to that many significant digits and the more compact of either decimal form or scientific notation is used. Scientific notation exponents contain a sign and at least two digits.
    "F"Fixed-pointPrecision specifier determines the number of decimal digits. Default value is NumberDecimalDigits.
    "N"NumberLike fixed-point, but also outputs group separators. Precision specifier determines the number of decimal digits. Default value is NumberDecimalDigits.
    "E"ExponentialExponential (scientific) notation. Precision specifier determines the number of decimal digits. Default value is 6. The exponent always contains a sign and at least three digits.
    "C"CurrencyPrecision specifier determines the number of decimal digits. Default value is CurrencyDecimalDigits.
    "P"PercentagePrecision specifier determines the number of decimal digits. Default value is PercentDecimalDigits.
    "R"Round-tripOutputs the mantissa followed by E and then the exponent, always using the InvariantCulture.

    Format specifiers are case-insensitive, but lowercase "g" and "e" specifiers produce a lowercase exponent character ("e") when scientific notation is used, matching the behavior of the standard .NET numeric types.

    Values are rounded using MidpointAwayFromZero when the format does not have enough precision to represent the value exactly.

    © Singulink. All rights reserved.