New to Telerik UI for .NET MAUIStart a free 30-day trial

.NET MAUI Numeric Mask

To validate the user input as numeric values, use the NumericMaskedEntry.

The numeric mask displays the following values:

  • Percent values.
  • Decimal values.
  • Currency (culture-aware).
  • Fixed point values.

Through the Mask property you can specify the exact format of the expected input. The following table lists the supported formats and the resulting type of the value with each format:

MaskNumeric TypeResulting .NET Type
"C" or "c"Currencydecimal
"D" or "d"Standardlong (int64)
"F" or "f"Fixed-pointdecimal
"G" or "g"Fixed-pointdecimal
"N" or "n"Decimaldecimal
"P" or "p"Percentdouble
OtherDecimaldecimal

For the full list of supported masks (except for the "E" and "X" ones), refer to the Standard Numeric masks MSDN article.

The following example demonstrates how to set the RadNumericMaskedEntry with the Currency value:

xaml
<telerik:RadNumericMaskedEntry Mask="C" AutomationId="numericMaskC"/>

The image below shows the end result.

.NET MAUI NumericMaskedEntry

For the MaskedEntry Numeric Mask examples, go to the SDKBrowser Demo Application and navigate to MaskedEntry -> Mask Types category.

See Also

In this article
See Also
Not finding the help you need?
Contact Support