essayer de calculer le montant de pourcentage, mais il retourne toujours 0.erreur dans le calcul du pourcentage
foreach (DataGridViewRow ligne dans dataGridView1.Rows) { à double igst_amt;
double amt = (Convert.ToDouble(row.Cells[dataGridView1.Columns[4].Index].Value)) * (Convert.ToDouble(row.Cells[dataGridView1.Columns[5].Index].Value));
row.Cells[dataGridView1.Columns[6].Index].Value = Convert.ToString(amt);
igst_amt = (igst/100)*(amt);
MessageBox.Show(Convert.ToString(igst_amt));
if (state == "o")
{
row.Cells[dataGridView1.Columns[9].Index].Value =Convert.ToString((cgst/100) *(amt));
row.Cells[dataGridView1.Columns[11].Index].Value =Convert.ToString((sgst/100) * (amt));
}
else if (state == "i")
{
row.Cells[dataGridView1.Columns[7].Index].Value = igst_amt;
}
double g_total = igst_amt + amt;
row.Cells[dataGridView1.Columns[13].Index].Value = Convert.ToString(g_total);
double t_g_total=0;
t_g_total+= g_total;
}
Quel est le type de 'igst'? –
le type de données est double double igst = 0; double cgst = 0; double sgst = 0; –
Est-ce que 'igst' devient non nul? –