mardi 30 juin 2020

add zero after point in Laravel

I am trying to add zero after point. For Example if price is 18 then I want to convert into 18.00 For this I am using Number Format and this is working.Below code is working perfectly. But problem is that, if price is 19.07 then its prints like 19.07999999998.

 Blade::directive('money', function ($amount) {
        return "<?php echo '$' . number_format($amount, 2); ?>";
    });
         if($this->app->environment('production'))
         {
             $this->app['request']->server->set('HTTPS','on');
            }
    
        }


via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire