My DataGrid receives double variables, I want to truncate them to two or three decimal places. My xaml code:
<DataGrid Name="McDataGrid" ItemsSource="{Binding}" Visibility="Collapsed" HorizontalAlignment="Center"
Margin="0, 200, 0, 0" VerticalAlignment="Top" CanUserAddRows="False" />
All of my C# code that touches the datagrid:
McDataGrid.DataContext = fillingDataGridUsingDataTable(string input).DefaultView;
McDataGrid.Visibility = Visibility.Visible;
fillingDataGridUsingDataTable(input) is a function that returns a DataTable with headers in string and values in double.