1

I have this piece of code:

int a = Convert.ToInt16(FractionSum1);
int b = Convert.ToInt16(s1);
int c = (a / b) + 1;
DecimalBox.Text = c.ToString("#.00");
DecimalBox.Update();

in this case a = 11 and b = 2, the answer I am trying to get is 6.50 but its outcome always shows 6.

what am I doing wrong? I have tried ToInt32 seems to make no difference, can anybody help?

Pooya
  • 1,508
  • 3
  • 17
  • 38
Sean Probyn
  • 123
  • 5

0 Answers0