• 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!

Powergamers expconvert

sunde

New Member
Joined
Nov 15, 2011
Messages
10
Reaction score
0
Hi everybody :)

Anyone know how can I edit my PHP - Powergamers.

I want implement:

K = 1,000 (Thousand) | M = 1,000,000 (Million) | B = 1,000,000,000 (Billion)

Actually when player get 100kk = 100.000.000 (And its it very long) better look this: 100M

herepz.png
 

Attachments

Found function:
PHP:
<?PHP

	#    Output easy-to-read numbers
    #    by james at bandit.co.nz
    function bd_nice_number($n)
	{
		number_format($n);
        $n = (0+str_replace(",","",$n));
        if(!is_numeric($n))
			return false;
 
        if($n>1000000000000) return round(($n/1000000000000),2).'T';
        else if($n>1000000000) return round(($n/1000000000),2).'B';
        else if($n>1000000) return round(($n/1000000),2).'M';
        else if($n>1000) return round(($n/1000),2).'K';
        
        return number_format($n);
    }
	
	// How to use
	$number = 516515468486;
	$main_content .= bd_nice_number($number);
	
	// Output: 516.52B
?>
 
PHP:
function convert($num) //by olafurw [at] gmail.com
    {
        $s = array('', 'TH', 'M', 'B', 'TR', 'Q');
        // , thousand, million, billion, trillion, quadrillion, etc 
        $e = floor(log($num)/log(1000));
      
        return sprintf('%.2f '.$s[$e], ($num/pow(1000, floor($e))));
    }
 
PHP:
    #    Output easy-to-read numbers
    #    by james at bandit.co.nz
    function bd_nice_number($n)
    {
        number_format($n);
        $n = (0+str_replace(",","",$n));
        if(!is_numeric($n))
            return false;
 
        if($n>1000000000000) return round(($n/1000000000000),2).'T';
        else if($n>1000000000) return round(($n/1000000000),2).'B';
        else if($n>1000000) return round(($n/1000000),2).'M';
        else if($n>1000) return round(($n/1000),2).'K';
        
        return number_format($n);
    }
    
    // How to use
    $number = 516515468486;
    $main_content .= bd_nice_number($number);
    
    // Output: 516.52B
?>

Can some1 tell me where to past it and how to use it ? i don't understand
 
Last edited:
Back
Top