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
Sorry for bumping this but I'm also having this problem.
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.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community