Skip to content

Commit 57e4940

Browse files
committed
Round to 3 decimal precision by default
1 parent dc24892 commit 57e4940

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/Debugger.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ public static function roundVersion(string $version) : string
244244
return $version;
245245
}
246246

247-
public static function roundSecondsToMilliseconds(float | int $seconds, int $precision = 6) : float
247+
public static function roundSecondsToMilliseconds(float | int $seconds, int $precision = 3) : float
248248
{
249249
return \round($seconds * 1000, $precision);
250250
}

tests/DebuggerTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -229,8 +229,8 @@ public function testRoundVersion() : void
229229
public function testRoundSecondsToMilliseconds() : void
230230
{
231231
self::assertSame(1000.0, Debugger::roundSecondsToMilliseconds(1));
232-
self::assertSame(0.120123, Debugger::roundSecondsToMilliseconds(0.000120123));
233-
self::assertSame(0.120, Debugger::roundSecondsToMilliseconds(0.000120, 3));
234-
self::assertSame(321.998765, Debugger::roundSecondsToMilliseconds(0.3219987654321));
232+
self::assertSame(0.120123, Debugger::roundSecondsToMilliseconds(0.000120123, 6));
233+
self::assertSame(0.120, Debugger::roundSecondsToMilliseconds(0.000120));
234+
self::assertSame(321.999, Debugger::roundSecondsToMilliseconds(0.3219987654321));
235235
}
236236
}

0 commit comments

Comments
 (0)