Laravel Convert Number ke SI

function getAmount($input){ $input = number_format($input,2); $input_count = substr_count($input, ','); if($input_count != '0'){ if($input_count == '1'){ return
 substr($input, 0, -4).'k'; } else if($input_count == '2'){ return substr($input, 0, -8).'m'; } else if($input_count == '3'){ return substr($input, 0, -12).'b'; }
else { return; } } else { return $input; } }
Yucky Yak