public static function materialRound(float $value)
    {
        if ($value > 999 && $value <= 999999) {
            return floor($value / 1000) . ' K';
        } elseif ($value > 999999) {
            return floor($value / 1000000) . ' M';
        }

        return $value;
    }
public static function materialRound(float $value)
    {
        if ($value > 999 && $value <= 999999) {
            return floor($value / 1000) . ' K';
        } elseif ($value > 999999) {
            return floor($value / 1000000) . ' M';
        }

        return $value;
    }
public static function materialRound ( float $ value ) { if ( $ value > 999 && $ value <= 999999 ) { return floor ( $ value / 1000 ) . ' K' ; } elseif ( $ value > 999999 ) { return floor ( $ value / 1000000 ) . ' M' ; } return $ value ; }
Rounds the float value with K or M sufixs.

@author Erik Campobadal Fores <soc@erik.cat>
@copyright 2017 erik.cat
@param float $value
@return float|string
Rounds the float value with K or M sufixs .