php - Doctrine 2, decimal can only contain 14 digits -
edit: confirmed bug in doctrine 2 http://www.doctrine-project.org/jira/browse/ddc-1112?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedcommentid=15724#action_15724
i have doctrine 2 entity , value mapped (with regular getter/setter):
/** * @column(type="decimal", precision=40, scale=30) */ protected $somevalue; /** * @return decimal */ public function getsomevalue() { return $this->somevalue; } /** * @param decimal $somevalue */ public function setsomevalue($somevalue) { $this->somevalue = $somevalue; } when set value code, value gets written database correctly. but, , problem, when value (via getter or \doctrine\common\util\debug::dump()), gives me number maximum 14 digits, , rounds value. read record default findbyid().
eg: value 1234567890.012345678901234567890123456789 have 1234567890.0123 eg: value 890.0123456789012345678901234567890123456 have 890.01234567890 i of course want digits, not 14. field in mysql declared this:
somevalue decimal(40,30) not null,
when value raw php , mysql_query(), returns correctly.
edit: seems problem doctrine returns float:
["somevalue":protected]=> float(234567890.01235) what's wrong, should check next, how fix, clues?
it sounds doctrine2 returning float value , running floating point precision while mysql_query() returning value string. can var_dump() on each returned variable , see scalar type.
Comments
Post a Comment