System.Globalization.NumberFormatInfo.NumberDecimalDigits Property

Gets or sets the number of decimal places to use in numeric values.

Syntax

public int NumberDecimalDigits { get; set; }

Value

A int containing the number of decimal places for numeric values.

Exceptions

TypeReason
ArgumentOutOfRangeExceptionThe value specified for a set operation is less than 0 or greater than 99.
InvalidOperationExceptionThe current instance is read-only and a set operation was attempted.

Remarks

The NumberFormatInfo.NumberDecimalDigits property is used with the "F" and "N" standard format strings without a precision specifier in numeric formatting operations. It defines the default number of fractional digits that appear after the decimal separator. This value is overridden if a precision specifier is used. For more information, see Standard Numeric Format Strings.

Requirements

Namespace: System.Globalization
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0