Hi,
I need to display decimal values in DataGridView
if (dgvClients.SelectedRows.Count != 0)
{
DataGridViewRow row = dgvClients.SelectedRows[0];
row.Cells["NetAccountValue"].Value = info.DecimalValue;
}
I need to format value up to given digits after decimal separator.
The problem is that cell Value
property stores reference to decimal in my case. When displayed decimal.ToString() is called and default decimal.ToString() produces unformatted string
with lots of digits.
One way is to create string and use String.FormatString() to achieve desired formatting and feed it Value instead of decimal.
Is there some other way?