durga prasad

durga prasad

  • NA
  • 54
  • 0

Converting Timespan to Decimal

Aug 7 2008 3:26 AM
Hi,
How to Convert TimeSpan to Decimal format, my code looks like this
 TimeSpan ts = new TimeSpan();
   ts = datetimepickerouttime.Value.TimeOfDay - datetimepickerintime.Value.TimeOfDay;
                    ts = ts.Subtract(TimeSpan.FromMinutes(30));
TextBox1.Text = Convert.ToDecimal(Convert.ToDecimal(ts.Hours) + (Convert.ToDecimal(ts.Minutes))).ToString("#.00");

Thanks in Advance,


Answers (1)