Skip to content

Commit

Permalink
Merge pull request #2 from TommyB123/pr
Browse files Browse the repository at this point in the history
Add leftover seconds to DurationFormat
  • Loading branch information
Southclaws authored Aug 13, 2018
2 parents bdf4484 + 0ff0f23 commit 51bc05d
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions chrono.inc
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,17 @@ stock DurationFormat(Seconds:duration, output[], len = sizeof output) {
);
}

if(duration > Seconds:0) {
format(
output,
len,
"%s%d second%s",
output,
_:duration,
(_:duration > 1) ? ("s, ") : (", ")
);
}

// trim the trailing comma
output[strlen(output) - 2] = EOS;

Expand Down

0 comments on commit 51bc05d

Please sign in to comment.