I have number like this:
2,800,000,000 billion
and I want show it like this 2.8 billion
I try this
{{rtrim($amounts,0)}}
but its show 28 billion and its not correct
how can write this in blade laravel?
>Solution :
you do it just like below
$number = 2800000000;
$formatted = number_format($number / 1000000000, 1, '.', '') . ' billion';
echo $formatted; // Output: 2.8 billion
for your specific case it could be something like this
{{number_format($amounts / 1000000000, 1, '.', '')}}