How can I do the php numberformat in laravel for a text type input two decimals?
{!!Form::text(number_format(campoaformatear,2,'.',',')null,['class'=>'form-control'])!!}
How can I do the php numberformat in laravel for a text type input two decimals?
{!!Form::text(number_format(campoaformatear,2,'.',',')null,['class'=>'form-control'])!!}
I think you should check with a shorthand of if / else, if there is $ field, to avoid an error when trying to format a null
{!! Form::text(
($campo) ? number_format($campo, 2, '.', ',') : ''
, null, ['class'=>'form-control']) !!}
The syntax you use should work without problem, although you need a comma (,), however I do not think you want to assign a name to the field that includes two decimals.
{!! Form::text(number_format($campo, 2, '.', ','), null, ['class'=>'form-control']) !!}