• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

AAC Top levels

GOD Coke

Mapper
Joined
Nov 25, 2015
Messages
58
Reaction score
14
Location
Dominican Republic
Can someone please help me with this
this is what I want it to come out, the level like 1,000M and not 1000000
topp.png
this is the one i have
top.png

PHP:
$players_skill .= '<li>• '.$order.'. <a class="playerlink" href="?subtopic=characters&name='.urlencode($skill['name']).'">'.($skill['online']>0 ? "<font color=\"green\">".$skill['name']."</font>" : "".$skill['name']."</font>").'</a></td> <span class="lvl"> '.$skill['level'].'</span></li>';
 
Last edited:
Solution
PHP:
<?php
    #    Output easy-to-read numbers
    #    by james at bandit.co.nz
    function bd_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;
        if($n>1000000000000) return round(($n/1000000000000),1).'T';
        else if($n>1000000000) return round(($n/1000000000),1).'B';
        else if($n>1000000) return round(($n/1000000),1).'M';
        else if($n>1000) return round(($n/1000),1).'T';
      
        return number_format($n);
    }
?>

Outputs:

247,704,360 -> 247.7M
866,965,260,000 -> 867B
PHP:
<?php
    #    Output easy-to-read numbers
    #    by james at bandit.co.nz
    function bd_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;
        if($n>1000000000000) return round(($n/1000000000000),1).'T';
        else if($n>1000000000) return round(($n/1000000000),1).'B';
        else if($n>1000000) return round(($n/1000000),1).'M';
        else if($n>1000) return round(($n/1000),1).'T';
      
        return number_format($n);
    }
?>

Outputs:

247,704,360 -> 247.7M
866,965,260,000 -> 867B
 
Solution
Back
Top