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

Monetary values should be stored either as decimal or, even better, as an integer in the smallest unit, like cent. http://stackoverflow.com/questions/3730019/why-not-use-double-or-float-to-represent-currency

Last updated 2 years ago.
0

Sorry for bumping this but I'm also having this problem.

Last updated 2 years ago.
0

Like you learned in your intro-to-intros pre-computer-science before highschool, never use floats where you care about decimal precision.

The easiest is bcmath http://php.net/manual/en/book.bc.php

It's things like this that makes me wish Laravel had a standard Decimal class the same way we have a Carbon class.

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

marcelg7 marcelg7 Joined 27 Feb 2014

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.