[DBAL-121] Mapping, decimal returns float. Created: 12/Apr/11 Updated: 14/May/11 Resolved: 14/May/11
|Reporter:||Tom Van Looy||Assignee:||Benjamin Eberlei|
Linux Ubuntu 10.10 x86_64, PHP 5.3.3-1ubuntu9.3, mysql Ver 14.14 Distrib 5.1.49
I have a Doctrine 2 entity and the value is mapped like this (with regular getter/setter):
When I set that value from my code, the value gets written into the database correctly. But, and that is my problem, when I get the value (via getter or \Doctrine\Common\Util\Debug::dump()), it always gives me a number with maximum 14 digits, and it rounds the value. I read the record with the default findById().
eg: with value 1234567890.012345678901234567890123456789 I have 1234567890.0123
I of course want all digits, not just 14. The field in MySQL is declared like this:
When I get the value with raw PHP and mysql_query(), it returns correctly.
It seems like the problem is that Doctrine returns a float: ["someValue":protected]=> float(234567890.01235)
What's wrong, what should I check next, how to fix, any clues?
|Comment by Benjamin Eberlei [ 12/Apr/11 ]|
ah yes, this is a bug.
|Comment by Benjamin Eberlei [ 14/May/11 ]|