Training
Module
Format alphanumeric data for presentation in C# - Training
Explore basic methods in C# to format alphanumeric data.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
You can configure how values are displayed in the Windows Forms NumericUpDown control. The DecimalPlaces property determines how many numbers appear after the decimal point; the default is 0. The ThousandsSeparator property determines whether a separator will be inserted between every three decimal digits; the default is false
. The control can display values in hexadecimal instead of decimal format, if the Hexadecimal property is set to true
; the default is false
.
Display a decimal value by setting the DecimalPlaces property to an integer and setting the ThousandsSeparator property to true
or false
.
NumericUpDown1.DecimalPlaces = 2
NumericUpDown1.ThousandsSeparator = True
numericUpDown1.DecimalPlaces = 2;
numericUpDown1.ThousandsSeparator = true;
numericUpDown1->DecimalPlaces = 2;
numericUpDown1->ThousandsSeparator = true;
-or-
Display a hexadecimal value by setting the Hexadecimal property to true
.
NumericUpDown1.Hexadecimal = True
numericUpDown1.Hexadecimal = true;
numericUpDown1->Hexadecimal = true;
Note
Even if the value is displayed on the form as hexadecimal, any tests you perform on the Value property will be testing its decimal value.
.NET Desktop feedback feedback
.NET Desktop feedback is an open source project. Select a link to provide feedback:
Training
Module
Format alphanumeric data for presentation in C# - Training
Explore basic methods in C# to format alphanumeric data.
Please sign in to use this experience.
Sign in