(I'm on a windows server and can't use money_format).
I'm trying to use NumberFormatter inside a Laravel view. I want to format the value inside the view directly rather than format inside the controller.
php_intl is enabled.
When called, I get the following error: Object of class NumberFormatter could not be converted to string (View: C:\xampp\htdocs\.eclipseproductsstesources\views\products.blade.php)
{!!$cash = new NumberFormatter("en-US", NumberFormatter::CURRENCY)!!}
@foreach($products as $product)
<tr>
<form action="{{url('/order/add')}}" method="post" data-ajax="false">
{!! csrf_field() !!}
<input type = "hidden" name = "pID" value = '{{$product->pID}}'/>
<td>{{$product->pName}}</td>
<td>{{$product->pBrand}}</td>
<td>{{$product->pCurrentType}}</td>
<td>{{$product->pVoltage}}V</td>
<td>${{ $cash->formatCurrency( $product->pPrice , "USD") }}</td>
<td><input type ="text" name="qty"/>
<input type = "submit" value="submit"></td>
</form>
</tr>
@endforeach