I'm trying to output a time. I have an int representing the hours and the minutes. Both need to be two digits, and they need to be output as string variables.
How do I output the numbers with two places?
For example, assume that
int hour = 8, int minute = 5
I need to make string timeOutput = 8:05
I thought it was
timeOutput = ("{0:D2}:{1:D2} ", hour, minute);
But that doesn't work.
How do I output the numbers with two places?
For example, assume that
int hour = 8, int minute = 5
I need to make string timeOutput = 8:05
I thought it was
timeOutput = ("{0:D2}:{1:D2} ", hour, minute);
But that doesn't work.
Comment