format an int data to local currency

1

I have a database and example in the view I call it

<td>{{ $payment -> pago }}</td>

but example is saved as INT, example if I have saved shows it to me so

3000

but I want you to show it this way

3,000.00

laravel has something simple to do that? that could make it happen to a js and there is to convert it ... but if you already have that. I do not want to generate more code. thank you very much.

    
asked by Luis Cárdenas 22.08.2016 в 22:01
source

1 answer

2

In this case the answer does not have Laravel but PHP, with the function number_format ():

{{ number_format($payment->pago, 2) }}

Here the official documentation: link

    
answered by 22.08.2016 / 22:09
source