Marvin kakuru

Marvin kakuru

  • 1.3k
  • 325
  • 155.3k

Decimal places

Jan 20 2012 10:37 AM
 

Hi there

I ope your all aright. I am working on small accounting project, and doing a lot of calculations. However problem is I need calculations to give results to two decimal places. Below is the code I tried to use but it didn't help.

}

int aw = System.Convert.ToInt32(textBox44.Text);

int ee = System.Convert.ToInt32(textBox1.Text);

int ff = System.Convert.ToInt32(textBox2.Text);

 

int rt = (aw * 28);

int rm = (rt / 2 * ee + rt/2 * ff);

 

textBox46.Text = rt.ToString("0.00");

textBox45.Text = rm.ToString("n0.00");

}

Any help will be greatly appreciated.

Thanks and best regards.


Answers (1)