We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c70f208 commit 7ff2708Copy full SHA for 7ff2708
1 file changed
src/utils/format-numbers.ts
@@ -425,7 +425,19 @@ export function formatTimestamp(
425
maxFractionalDigits: number = 3,
426
// precision is the minimum required precision.
427
precision: Milliseconds = Infinity
428
-) {
+): string {
429
+ if (time < 0) {
430
+ return (
431
+ '-' +
432
+ formatTimestamp(
433
+ Math.abs(time),
434
+ significantDigits,
435
+ maxFractionalDigits,
436
+ precision
437
+ )
438
+ );
439
+ }
440
+
441
if (precision !== Infinity) {
442
// Round the values to display nicer numbers when the extra precision
443
// isn't useful. (eg. show 3h52min10s instead of 3h52min14s)
0 commit comments