BadgeNavigationItemRenderer: Round counts to the neareset base
refs #3568
This commit is contained in:
parent
e992eb6b26
commit
f0b5d8fd8e
library/Icinga/Web/Navigation/Renderer
|
@ -113,6 +113,12 @@ abstract class BadgeNavigationItemRenderer extends NavigationItemRenderer
|
|||
protected function renderBadge()
|
||||
{
|
||||
if ($count = $this->getCount()) {
|
||||
if ($count > 1000000) {
|
||||
$count = round($count, -6) / 1000000 . 'M';
|
||||
} elseif ($count > 1000) {
|
||||
$count = round($count, -3) / 1000 . 'k';
|
||||
}
|
||||
|
||||
$view = $this->view();
|
||||
return sprintf(
|
||||
'<span title="%s" class="badge state-%s">%s</span>',
|
||||
|
|
Loading…
Reference in New Issue