Support the ongoing development of Laravel.io →
Blade Laravel Views
Last updated 2 years ago.
0

I changed my view iterator to the following and i'm getting neatly formatted numbers, it doesn't feel very neat or clever to be doing this - is there a laravel way of doing it?

https://paste.laravel.io/q398R

<?php
if ($key == 'item_weight' || $key == 'item_dim1' || $key == 'item_dim2'|| $key == 'item_dim3'|| $key == 'item_value'|| $key == 'item_insured_value')
{
   $val = number_format($val, 2, '.', ',');
}
?>
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Paul takesthebiscuit Joined 25 Aug 2017

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.