Skip to content

Commit dc1705a

Browse files
committed
Abbreviate ToDescription because custom times can be long.
1 parent 74458d5 commit dc1705a

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

Program.cs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,18 @@ public static string ToDescription(int time) {
2626
if(time >= 60) {
2727
int hours = time / 60;
2828
if (hours == 1) {
29-
returnDescription = "1 hour ";
29+
returnDescription = "1 hr ";
3030
}
3131
else {
32-
returnDescription = String.Format("{0} hours ", hours);
32+
returnDescription = String.Format("{0} hrs ", hours);
3333
}
3434
}
3535
int mins = time % 60;
36-
if (mins != 0) {
37-
returnDescription += String.Format("{0} minutes", mins);
36+
if(mins == 1) {
37+
returnDescription += String.Format("{0} min", mins);
38+
}
39+
if (mins > 1) {
40+
returnDescription += String.Format("{0} mins", mins);
3841
}
3942

4043
return returnDescription;

0 commit comments

Comments
 (0)