Time.ToString("0.0")
shows up as a decimal "1.5" for instead of 1:30. How can I get it to display in a 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";
}
Best Answer
Formats:
EDIT: Since now we know the time is a
double
change the code to (assuming you want hours and minutes):or