From 0f7b3c653ab3d3b42c36b1b867f8e5884187af43 Mon Sep 17 00:00:00 2001 From: Randy Schott <1815175+schottra@users.noreply.github.com> Date: Mon, 6 Jul 2020 16:38:22 -0700 Subject: [PATCH] fix: show full millisecond values for subsecond durations (#81) --- src/common/formatters.ts | 2 +- src/common/test/formatters.spec.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/common/formatters.ts b/src/common/formatters.ts index 0011c0459..5d29f77e7 100644 --- a/src/common/formatters.ts +++ b/src/common/formatters.ts @@ -71,7 +71,7 @@ export function millisecondsToHMS(valueMS: number): string { } if (valueMS < 1000) { - return subSecondString; + return `${valueMS}ms`; } const duration = moment.duration(valueMS); diff --git a/src/common/test/formatters.spec.ts b/src/common/test/formatters.spec.ts index 718ce5db0..5f209743a 100644 --- a/src/common/test/formatters.spec.ts +++ b/src/common/test/formatters.spec.ts @@ -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'],