Back to Devexpress

How to: Format a Column's Numeric Values as Currency

windowsforms-2157-controls-and-libraries-tree-list-examples-how-to-format-a-columns-numeric-values-as-currency.md

latest1022 B
Original Source

How to: Format a Column's Numeric Values as Currency

  • Aug 01, 2019

The following example shows how to use the standard format specifiers in a column that displays numeric values. The column’s format string is set to “c2”. This indicates that a value will be formatted as a currency amount with two digits to the right of the decimal point.

The following image shows the result:

For information on format specifiers, refer to the Format Specifiers topic.

csharp
treeList1.Columns["Currency"].Format.FormatType = DevExpress.Utils.FormatType.Numeric;
treeList1.Columns["Currency"].Format.FormatString = "c2";
vb
treeList1.Columns("Currency").Format.FormatType = DevExpress.Utils.FormatType.Numeric
treeList1.Columns("Currency").Format.FormatString = "c2"