Time.ToString("0.0") displayed as the decimal value of "1.5" instead of 1:30. How can I display it in time format?
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
Michael quiles
source share