Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

How to: Format a Numeric Value according to its Sign

The following example shows how to provide different formats for positive and negative numeric values and the zero value in a CalcEdit editor.

The result is demonstrated in the image below.

FormatDisplayAndEditValues_customFormat

using DevExpress.Utils;
// ...
calcEdit1.Properties.DisplayFormat.FormatType = FormatType.Numeric;
calcEdit1.Properties.DisplayFormat.FormatString = "#.00;[#.0];Zero";