转换小数* 3导致货币?

时间:2011-11-20 02:12:44

标签: c#

        TimeSpan span1 = TimeSpan.FromHours(dtmIn.Value.Hour);
        TimeSpan span2 = TimeSpan.FromHours(dtmOut.Value.Hour);
        TimeSpan span3 = TimeSpan.FromMinutes(dtmIn.Value.Minute);
        TimeSpan span4 = TimeSpan.FromMinutes(dtmOut.Value.Minute);
        TimeSpan span5 = span2.Subtract(span1) + span4.Subtract(span3);
        if (dtmOut.Value.Hour < dtmIn.Value.Hour)
            MessageBox.Show("Time Out can not be less");
        lblTotal.Text = span5.TotalHours.ToString("#.00");

我如何使用span5并将其乘以3?

1 个答案:

答案 0 :(得分:2)

    lblTotal.Text = (span5.TotalHours * 3).ToString("#.00");