jimgwhit said:
Yes I'm aware of that. It doesn't solve the problem as going thru Eloquent the float is changed, and not with plain PHP querying – so the problem must be with Eloquent.
where it's returning 330, what is the actual value stored in the database? Try to store 330.152 for example and pluck that to test.
Update, I just tryed it, it's returning for me 390.1463, which is what I entered in database. Are you sure you have datatype float in database?
jimgwhit said:
where it's returning 330, what is the actual value stored in the database? Try to store 330.152 for example and pluck that to test.
Update, I just tryed it, it's returning for me 390.1463, which is what I entered in database. Are you sure you have datatype float in database?
The problem is that the database has 333.33 as it should when looked with PhpMyAdmin. The schema is with with float() and default value 0.00 for all those field. And it seems the database also writes the float fine – but when queried thru Eloquent it returns 330 (of type double).
Today I'm finishing building an almost identical Vagrant instance than with our host, so that I can test PHP 5.4.36 + MySQL 5.5.40 combination with this Laravel version...
this is why its important to have test server before updating the live site with the latest updates.. (i know its not helpful but one for the future)
I have opened an issue on this after trying to replicate the problem locally with nearly identical Vagrant platform: https://github.com/laravel/framework/issues/7075
This issue was never solved... Migrated to another server to start afresh.
I have the same problem, and i have found a solution.
You need to use float() in your migration file. And not to change your input type in your database, because the float() function create a "double" type in your database and not a "float" type. Try to change in double and it'll work fine!
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community