<!-- 
RSS generated by JIRA (5.2.7#850-sha1:b2af0c8dc8537b36121c6a579fabbdf79fc919e5) at Mon May 20 15:22:54 UTC 2013

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary add field=key&field=summary to the URL of your request.
For example:
http://www.doctrine-project.org/jira/si/jira.issueviews:issue-xml/DBAL-121/DBAL-121.xml?field=key&field=summary
-->
<rss version="0.92" >
<channel>
    <title>Doctrine Project</title>
    <link>http://www.doctrine-project.org/jira</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>5.2.7</version>
        <build-number>850</build-number>
        <build-date>21-02-2013</build-date>
    </build-info>

<item>
            <title>[DBAL-121] Mapping, decimal returns float.</title>
                <link>http://www.doctrine-project.org/jira/browse/DBAL-121</link>
                <project id="10040" key="DBAL">Doctrine DBAL</project>
                        <description>&lt;p&gt;I have a Doctrine 2 entity and the value is mapped like this (with regular getter/setter):&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt; 
/**
 * @Column(type=&lt;span class=&quot;code-quote&quot;&gt;&quot;decimal&quot;&lt;/span&gt;, precision=40, scale=30)
 */
&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; $someValue;

/**
 * @&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; decimal
 */
&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function getSomeValue()
{
    &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;someValue;
}

/**
 * @param decimal $someValue
 */
&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; function setSomeValue($someValue)
{
    $&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;-&amp;gt;someValue = $someValue;
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;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().&lt;/p&gt;

&lt;p&gt;eg: with value 1234567890.012345678901234567890123456789 I have 1234567890.0123&lt;br/&gt;
eg: with value 890.0123456789012345678901234567890123456 I have 890.01234567890&lt;/p&gt;

&lt;p&gt;I of course want all digits, not just 14. The field in MySQL is declared like this:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt; 
    someValue decimal(40,30) NOT NULL,
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt; 

&lt;p&gt;When I get the value with raw PHP and mysql_query(), it returns correctly.&lt;/p&gt;

&lt;p&gt;It seems like the problem is that Doctrine returns a float: &lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;someValue&amp;quot;:protected&amp;#93;&lt;/span&gt;=&amp;gt; float(234567890.01235)&lt;/p&gt;

&lt;p&gt;What&apos;s wrong, what should I check next, how to fix, any clues?&lt;br/&gt;
(also posted on &lt;a href=&quot;http://stackoverflow.com/questions/5635500/doctrine-2-decimal-can-only-contain-14-digits&quot; class=&quot;external-link&quot;&gt;http://stackoverflow.com/questions/5635500/doctrine-2-decimal-can-only-contain-14-digits&lt;/a&gt;)&lt;/p&gt;</description>
                <environment>Linux Ubuntu 10.10 x86_64, PHP 5.3.3-1ubuntu9.3, mysql  Ver 14.14 Distrib 5.1.49</environment>
            <key id="12556">DBAL-121</key>
            <summary>Mapping, decimal returns float.</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                                <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="tvlooy">Tom Van Looy</reporter>
                        <labels>
                    </labels>
                <created>Tue, 12 Apr 2011 09:24:17 +0000</created>
                <updated>Sat, 14 May 2011 10:23:46 +0000</updated>
                    <resolved>Sat, 14 May 2011 10:23:46 +0000</resolved>
                            <version>2.0.3</version>
                                <fixVersion>2.0.5</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="15724" author="beberlei" created="Tue, 12 Apr 2011 10:12:29 +0000"  >&lt;p&gt;ah yes, this is a bug.&lt;/p&gt;</comment>
                    <comment id="15851" author="beberlei" created="Sat, 14 May 2011 10:23:46 +0000"  >&lt;p&gt;fixed&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>
</channel>
</rss>