Skip to content

Commit

Permalink
fix: show full millisecond values for subsecond durations (#81)
Browse files Browse the repository at this point in the history
  • Loading branch information
schottra authored Jul 6, 2020
1 parent bed1b81 commit 0f7b3c6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/common/formatters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export function millisecondsToHMS(valueMS: number): string {
}

if (valueMS < 1000) {
return subSecondString;
return `${valueMS}ms`;
}

const duration = moment.duration(valueMS);
Expand Down
4 changes: 2 additions & 2 deletions src/common/test/formatters.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ describe('formatDateLocalTimezone', () => {
const millisecondToHMSTestCases: [number, string][] = [
[-1, unknownValueString],
[0, zeroSecondsString],
[1, subSecondString],
[999, subSecondString],
[1, '1ms'],
[999, '999ms'],
[1000, '1s'],
[60000, '1m'],
[61000, '1m 1s'],
Expand Down

0 comments on commit 0f7b3c6

Please sign in to comment.