RadInput for ASP.NET AJAX

RadControls for ASP.NET AJAX

The NumberFormat property controls how RadNumericTextBox formats its value. The format that you specify in this way is applied when the numeric text box does not have focus. During editing, RadNumericTextBox always uses the actual number.

Note

The value of NumberFormat takes precedence over both the Type property and the Culture property.

NumberFormat is a composite property with the following sub-properties:

 
Sub-propertyTypeDescription
AllowRoundingBooleanSpecifies whether the value is rounded (when set to true) or truncated (when set to false ) when the number of decimal places exceeds the value of DecimalDigits.
KeepNotRoundedValueBooleanSpecifies whether the control will keep its not rounded value (when set to true) and show it when it is focused. Otherwise (when set to false) the old behavior is preserved, where the actual value of the control is the rounded value. By default this property is set to false.
KeepTrailingZerosOnFocusBooleanSpecifies whether the control will keep its zero numbers(when set to true) and show them when it is focused, according to the DecimalDigits setting. Otherwise (when set to false) the old behavior is preserved - the control will not display decimal zeros when focused. By default this property is set to false.
DecimalDigitsIntegerSpecifies the number of digits that are displayed after the decimal separator.
DecimalSeparatorCharacterSpecifies the character that separates the fractional portion of a number.
GroupSeparatorCharacterSpecifies the character that separates each group of digits.
GroupSizesIntegerSpecifies the number of digits in each group, starting from the decimal separator.
NegativePatternStringSpecifies the pattern for formatting negative values. (See below for details on formatting patterns.)
PositivePatternStringSpecifies the pattern for formatting positive values. (See below for details on formatting patterns.)

Formatting patterns

Formatting patterns are strings that control the placement of elements when formatting a numeric value. A Formatting pattern consists of the special symbol n, which represents the number, plus any literal characters that are part of the formatted value. Typically, the literal values are characters such as the negative sign ("-"), a currency symbol ("$"), parentheses, and so on.

Note

The characters other than n in a formatting pattern are literal symbols. If you use the dollar sign ("$") as a currency symbol, for example, currency values are formatted using that symbol regardless of the value of the Culture property.

For a live example of different NumberFormat settings, see Formatting Value.

See Also