Skip to content

Commit

Permalink
Show only three significant digits in check execution time
Browse files Browse the repository at this point in the history
fixes #8849
  • Loading branch information
Al2Klimov committed May 15, 2015
1 parent 58434d9 commit 533c980
Showing 1 changed file with 12 additions and 1 deletion.
Expand Up @@ -68,7 +68,18 @@ if ($object->getType() === $object::TYPE_HOST) {
<?php if ($object->check_execution_time): ?>
<tr>
<th><?= $this->translate('Check execution time') ?></th>
<td><?= $object->check_execution_time ?>s</td>
<td><?php
$matches = array();
if (preg_match(
'/(?<!.)([0-9]+\.[0-9]{4,})(?!.)/ms',
$object->check_execution_time,
$matches
)) {
printf('%.3f', (float) $matches[1]);
} else {
echo $object->check_execution_time;
}
?>s</td>
</tr>
<?php endif ?>
<?php if ($object->check_latency): ?>
Expand Down

0 comments on commit 533c980

Please sign in to comment.