MaskedNumericInput
The MaskedNumericInput control can be used when you need to display numeric values such as Percent, Decimal, Currency (culture-aware) or Fixed-point values.
Example 1: Adding a RadMaskedNumericInput in XAML to handle currency input
<input:RadMaskedNumericInput Mask="C3" />
Standard Numeric Masks
Full list of the supported masks (except "E" and "X") can be found in the following MSDN article: Standard Numeric masks.
The following table lists the supported formats and the resulting type of the value with each format:
Mask | Numeric Type | Resulting .NET Type |
---|---|---|
"C" or "c" | Currency | decimal |
"D" or "d" | Standard | long (int64) |
"F" or "f" | Fixed-point | decimal |
"G" or "g" | Fixed-point | decimal |
"N" or "n" | Decimal | decimal |
"P" or "p" | Percent | double |
Other | Decimal | decimal |
When used in a data-binding scenario, the bound property in the viewmodel needs to match the type of the resulting value (or its corresponding nullable equivalent).