$number = 2768888;
$divisor = 1000000;
$number = $number / $divisor;
return number_format($number, 2, $separator). $shorthand;
public static function numberFormat($number, $decimals = 0, $decPoint = '.' , $thousandsSep = ','): string
{
$negation = ($number < 0) ? (-1) : 1;
$coefficient = 10 ** $decimals;
$number = $negation * floor((string)(abs($number) * $coefficient)) / $coefficient;
return number_format($number, $decimals, $decPoint, $thousandsSep);
}