I highly recommend using inline formatted strings where possible, such as N2 .
string s = number.ToString("N2");
Use John Sheehan . Quick reference information on NET strings . Crib if in doubt. It contains all the necessary information about formatting numbers and dates in .NET.
DevExpress controls typically require you to specify what you are formatting (e.g. number, date, etc.):
calcEdit.Properties.DisplayFormat.FormatType = FormatType.Numeric; calcEdit.Properties.DisplayFormat.FormatString = "N2";
If no format type is specified, the format string will not be applied.
With TextEdit, you must specify a mask instead.
textEdit.Properties.Mask.MaskType = MaskType.Numeric; textEdit.Properties.Mask.EditMask = "N2";
source share