Time.ToString("0.0")
顯示爲十進制「1.5」而不是1:30。我怎樣才能讓它以時間格式顯示?將時間轉換爲C#中的格式化字符串
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";
}
什麼類型是時間? 它是浮動的嗎? – 2010-04-26 21:14:37