int i; int NbLig = DGV_P9_Commande.Rows.Count; Double Val = 0; for (i = 0; i < NbLig; i++) { Val += Convert.ToDouble(DGV_P9_Commande.Rows[i].Cells[5].Value); } Txt_total_P9_cmd.Text = Convert.ToString(Val) + " €uros H.T";
Txt_total_P9_cmd.Text = string.Format ( "{0} €uros H.T.", Math.Round(Val, 2) );
Txt_total_P9_cmd.Text = string.Format ( "{0} €uros H.T.", Val.ToString("D2") );
Thank you, I changed the format like this : string.Format("{0:0.00} And I get my result well. <pre lang="c#"> Txt_total_P9_cmd.Text = string.Format("{0:0.00} Euros H.T.", Math.Round(Val, 2));
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)