Here is the function from the extension linked to above, just add it to the end of /includes/functions.php You'll also need to replace the values for the suffix because there is no language file. e.g.
Now you can apply it to any number you want, for example in viewforum.php on line 971 find:
Replace with:Untested but it should work.
$suffix = 'K';
for thousands. Code:
function number_format_short($n){if ($n >= 0 && $n < 10000){// 1 - 9999$n_format = floor($n);$suffix = '';}else if ($n >= 10000 && $n < 1000000){// 10k-999k$n_format = floor($n / 1000);$suffix = $this->language->lang('THOUSAND_SHORT_SUFFIX');}else if ($n >= 1000000 && $n < 1000000000){// 1m-999m$n_format = floor($n / 1000000);$suffix = $this->language->lang('MILLION_SHORT_SUFFIX');}else if ($n >= 1000000000 && $n < 1000000000000){// 1b-999b$n_format = floor($n / 1000000000);$suffix = $this->language->lang('BILLION_SHORT_SUFFIX');}else if ($n >= 1000000000000){// 1t+$n_format = floor($n / 1000000000000);$suffix = $this->language->lang('TRILLION_SHORT_SUFFIX');}$temp = $n_format . $suffix;return !empty($temp) ? $n_format . $suffix : 0;}
Now you can apply it to any number you want, for example in viewforum.php on line 971 find:
Code:
'REPLIES'=> $replies,
Code:
'REPLIES'=> number_format_short($replies),
Statistics: Posted by thecoalman — Thu Feb 01, 2024 3:04 am