[Expand]General Information
[Collapse]WinForms Controls
  .NET Core Support
 [Expand]What's Installed
 [Expand]Build an Application
 [Expand]Controls and Libraries
 [Collapse]Common Features
  [Expand]Data Binding Common Concepts
  [Expand]Data Source Wizard
  [Expand]Application Appearance and Skin Colors
  [Expand]Filtering UI Context
   Find Panel Syntax
  [Expand]Graphics Performance and High DPI
  [Expand]Scaffolding Wizard
  [Collapse]Formatting Values
    How to: Format Date-Time Values Using the LongDate Pattern
    How to: Format Date-Time Values Using a Custom Format Pattern
    How to: Format a Numeric Value according to its Sign
    How to: Add Custom Text to a Formatted String
    How to: Create a Custom Formatter to Change the Case of String Values
    How to: Create a Custom Formatter to Represent Decimal Values in Binary
    Formatting Approaches
    Members that Support the Formatting Mechanism
    Format Specifiers
    Composite Formatting
    Custom Formatting
   HTML-inspired Text Formatting
  [Expand]Tooltip Management
  [Expand]Save and Restore Layouts
   Clipboard - Copy and Paste Operations. Data Formatting
   Version Compatibility: Default Property Values
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Report and Dashboard Server
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

Formatting Approaches

The formatting mechanism allows you to format values using one of the following approaches:

  • Using the standard or custom format specifiers.

    These let you format numeric and date-time values according to predefined or custom patterns (they are all described in MSDN and can also be found in the Format Specifiers topic). For instance, a numeric value can be represented as a currency amount or a hexadecimal value, using scientific notation, etc. A date/time value can be represented in the standard Short Date. Long Date or Full Date/Time form.

    Custom format specifiers can be used to construct a new custom pattern if the standard patterns do not suit your needs. Custom text can be added to the resultant string when using custom format specifiers.

  • Using composite formatting.

    This feature extends the previous one, as it allows you to format numeric and date/time values using one of the standard or custom format specifiers, and adds any custom text to the resultant string. When formatting string values, it is also possible to add custom text to the resultant string.

    See the Composite Formatting topic for details.

  • Using a custom formatter.

    This gives you the ability to format values of any type, though you will need to format values manually via code. See the Custom Formatting topic for more details.

Is this topic helpful?​​​​​​​