mike Delvotti

mike Delvotti

  • NA
  • 262
  • 0

Multiply date value by Number value

Jul 18 2011 4:08 AM
Guys, I'm trying to calculate my total time textbox by the hourly rate textbox. below is an example of how my total time textbox is being output

totalTime.Text = String.Format("{0:D2}:{1:D2}", diff1.Hours, diff1.Minutes);

I have an hour rate textbox that formats by a number like: 45 I want to multiply the hourly rate by the total time, my code below throws an error, and I'm sure it's to do with the formatting?

 int label10 = 0;
            int label11 = 0;

            label10 = Convert.ToInt32(labTxt.Text);
            label11 = Convert.ToInt32(totalTime.Text);

            int total = label10 * label11;
            netLab.Text = total.ToString("F2");

Answers (2)