1
I am developing a project in which the result of the division of the 5 items always 0, someone can help me to tidy up
private void btnCalcu_Click(object sender, EventArgs e)
{
//convertendo
Total = Convert.ToInt32(txtFechado.Text);
SemInt = Convert.ToInt32(txtSemInt.Text);
LigDepois = Convert.ToInt32(txtLigaDps.Text);
Negoc = Convert.ToInt32(txtNegoc.Text);
Agend = Convert.ToInt32(txtAgend.Text);
//Calculando
totalLig = Total + SemInt + LigDepois + Negoc + Agend;
porc = (Total/100) * totalLig;
TotPoc = Convert.ToDouble(porc);
MessageBox.Show("Total de ligações é: " + totalLig + " Pocentual é : " +TotPoc );
}
This will not be related to the values you are using in the calculation?
– João Martins
@Joãomartins, the
TotPoc
no, but thetotalLig
yes that is strange, I do not know if I am wrong in the logic of the account or what– Pietro Nunciaroni
Edit your question and put the example values you are using, maybe this way we can come up with a solution?
– João Martins