Format values in a Datagrid

One easiest way. here in the code below use your language code as a value of ConverterCulture. you can find your language code here

<DataGridTextColumn Binding="{Binding Profit, ConverterCulture='gu-IN' ,StringFormat=c}" Header="Profit" Width="*" MinWidth="80" FontWeight="Normal"/>

the output will be in your local currency output screenshot

for anything other than currency find stringFormat specifier here


Use the StringFormat property:

<DataGridTextColumn Binding="{Binding Path=Date, StringFormat=d}" Header="Date" />
<DataGridTextColumn Binding="{Binding Path=Amount, StringFormat=C}" Header="Amount" />
  • Standard Numeric Format Strings
  • Standard Date and Time Format Strings

Tags:

C#

Wpf