I have this code , i have search in the site how to format a column
listView2.Items.Clear();
listView2.GridLines = true;
for (int i = 0; i < miraxy.Rows.Count; i++)
{
DataRow drow = miraxy.Rows[i];
if (drow.RowState != DataRowState.Deleted)
{
ListViewItem lvi = new ListViewItem(drow["CFOP"].ToString());
lvi.SubItems.Add(drow["Tnota"].ToString());
lvi.SubItems.Add(drow["Valor"].ToString());
listView2.Items.Add(lvi);
}
}
i need to format the column "Valor" to 123.2456.789,2345 i have try with this code but don work .i need format to 2 decimal places.
lvi.SubItems.Add( string.Format( "{0:000,000.00}",drow["Valor"].ToString()));
With this line :
lvi.SubItems.Add( string.Format( "{0:000,000.00}", Convert.ToDecimal (drow["Valor"])));
i have this result :
1.419.192,67
001.528,41 how i need to write to kill the left zeros??
Thanks by any help