osb/helpers.php

10 lines
354 B
PHP

<?php
if (! function_exists('markup')) {
function markup($a,$b) {
return ($a > $b)
? sprintf('<span class="badge bg-danger>">(%3.1f%%)</span>',$a ? ($b-$a)/($b ?: 1)*100 : 100)
: sprintf('<span class="badge">%3.1f%%</span>',$a ? ($b-$a)/($b ?: 1)*100 : ($b ? 100: 0));
}
}