【发布时间】:2010-04-26 21:10:30
【问题描述】:
Time.ToString("0.0") 显示为十进制“1.5”而不是 1:30。如何让它以时间格式显示?
private void xTripSeventyMilesRadioButton_CheckedChanged(object sender, EventArgs e)
{
//calculation for the estimated time label
Time = Miles / SeventyMph;
this.xTripEstimateLabel.Visible = true;
this.xTripEstimateLabel.Text = "Driving at this speed the estimated travel time in hours is: " + Time.ToString("0.0") + " hrs";
}
【问题讨论】:
-
时间是什么类型?它是浮动的吗?
标签: c# time string-formatting