- Output for 5.3.0 - 5.3.28, 5.4.0 - 5.4.27
- Parse error: syntax error, unexpected ';' in /in/hoT40 on line 15
Process exited with code 255.
<?php
if (!function_exists('nice_number')) {
function nice_number($n) {
// first strip any formatting;
$n = (0 + str_replace(",", "", $n));
// is this a number?
if (!is_numeric($n))
return false;
// now filter it;
$str = '';
if ($n > 1000000000000) {
$str = round(($n / 1000000000000), 0) . ' tn ';
$str .= $n % 1000000000000 > 0 ? nice_number($n % 1000000000000); : '';
return $str;
}
else if ($n > 1000000000) {
$str = round(($n / 1000000000), 0) . ' bn ';
$str .= $n % 1000000000 > 0 ? nice_number($n % 1000000000); : '';
return $str;
}
else if ($n > 1000000) {
$str = round(($n / 1000000), 0) . ' mn ';
$str .= $n % 1000000 > 0 ? nice_number($n % 1000000); : '';
return $str;
}
else if ($n > 1000)
return round(($n / 1000), 20) . ' K ';
return number_format($n);
}
}
echo nice_number(300000000);