public function shortenNumber($number)
    {
        $abbr = [9 => 'B', 6 => 'M', 3 => 'K'];

        foreach ($abbr as $exponent => $suffix) {
            if ($number >= pow(10, $exponent)) {
                return intval($number / pow(10, $exponent)) . $suffix;
            }
        }

        return $number;
    }
public function shortenNumber($number)
    {
        $abbr = [9 => 'B', 6 => 'M', 3 => 'K'];

        foreach ($abbr as $exponent => $suffix) {
            if ($number >= pow(10, $exponent)) {
                return intval($number / pow(10, $exponent)) . $suffix;
            }
        }

        return $number;
    }
public function shortenNumber ( $ number ) { $ abbr = [ 9 => 'B' , 6 => 'M' , 3 => 'K' ] ; foreach ( $ abbr as $ exponent => $ suffix ) { if ( $ number >= pow ( 10 , $ exponent ) ) { return intval ( $ number / pow ( 10 , $ exponent ) ) . $ suffix ; } } return $ number ; }
Compact a number into short-hand

@param  int    $number
@return string
Compact a number into short - hand