Parser profiling data: Nicer float format

No need to display three decimal points for the
given cpu limit all the time.

Will change outputs like:
"1.728/10.000 seconds"
to
"1.728/10 seconds"

Change-Id: Ib1f5b435825232eaf9fde7ff0d953c137c06ac32
This commit is contained in:
Marius Hoch 2018-05-30 17:31:12 +02:00 committed by jenkins-bot
parent 704f1231d2
commit 8dbde85b69

View file

@ -39,7 +39,8 @@ class Scribunto_LuaStandaloneEngine extends Scribunto_LuaEngine {
$output->setLimitReportData( 'scribunto-limitreport-timeusage',
[
sprintf( "%.3f", $status['time'] / $this->getClockTick() ),
sprintf( "%.3f", $this->options['cpuLimit'] )
// Strip trailing .0s
rtrim( rtrim( sprintf( "%.3f", $this->options['cpuLimit'] ), '0' ), '.' )
]
);
$output->setLimitReportData( 'scribunto-limitreport-virtmemusage',