<!-- 
RSS generated by JIRA (5.2.7#850-sha1:b2af0c8dc8537b36121c6a579fabbdf79fc919e5) at Wed May 22 21:10:50 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-180/DBAL-180.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-180] Documentation states that Doctrine &apos;decimal&apos; (DecimalType) is mapped to PHP &apos;double&apos;, however, string is returned</title>
                <link>http://www.doctrine-project.org/jira/browse/DBAL-180</link>
                <project id="10040" key="DBAL">Doctrine DBAL</project>
                        <description>&lt;p&gt;At &lt;a href=&quot;http://www.doctrine-project.org/docs/orm/2.1/en/reference/basic-mapping.html#doctrine-mapping-types&quot; class=&quot;external-link&quot;&gt;http://www.doctrine-project.org/docs/orm/2.1/en/reference/basic-mapping.html#doctrine-mapping-types&lt;/a&gt;, it is stated that:&lt;/p&gt;

&lt;p&gt;&quot;decimal: Type that maps an SQL DECIMAL to a PHP double.&quot;&lt;/p&gt;

&lt;p&gt;However, in the commit history, we can see that the casting to a float is removed: &lt;a href=&quot;https://github.com/doctrine/dbal/commits/master/lib/Doctrine/DBAL/Types/DecimalType.php&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/dbal/commits/master/lib/Doctrine/DBAL/Types/DecimalType.php&lt;/a&gt;. Casting to a double is not possible in PHP?This seems to result in a float as well, that is probably why it was removed.&lt;/p&gt;

&lt;p&gt;I found this out when using PHP&apos;s &apos;is_double()&apos; function (alias of is_float()) to check whether a decimal property was set or not. &lt;/p&gt;

&lt;p&gt;Suggestion is to either:&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;cast to a double (which seems not possible)&lt;/li&gt;
	&lt;li&gt;cast to a float (why was this removed?)&lt;/li&gt;
	&lt;li&gt;do nothing to the code, update documentation that string is returned.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;In my check function I guess I will use the is_numeric() function. &lt;/p&gt;</description>
                <environment></environment>
            <key id="13171">DBAL-180</key>
            <summary>Documentation states that Doctrine &apos;decimal&apos; (DecimalType) is mapped to PHP &apos;double&apos;, however, string is returned</summary>
                <type id="6" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/documentation.png">Documentation</type>
                                <priority id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/minor.png">Minor</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="holtkamp">Menno Holtkamp</reporter>
                        <labels>
                    </labels>
                <created>Fri, 11 Nov 2011 15:01:32 +0000</created>
                <updated>Thu, 20 Dec 2012 00:31:46 +0000</updated>
                                    <version>2.1.2</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="17623" author="roelharbers" created="Mon, 19 Mar 2012 16:10:01 +0000"  >&lt;p&gt;I would strongly suggest to leave the behaviour as-is, and fix the documentation, because of all the trouble associated with floating point and rounding. People use the DECIMAL type to prevent those issues, so having the ORM convert it to floating point again would be pretty bad.&lt;/p&gt;</comment>
                    <comment id="17887" author="pmcdougl" created="Thu, 26 Apr 2012 19:31:35 +0000"  >&lt;p&gt;I have submitted a pull request on this issue on github. Hopefully the doc will be updated soon so other people don&apos;t expect the wrong behavior!&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/doctrine/orm-documentation/pull/93&quot; class=&quot;external-link&quot;&gt;https://github.com/doctrine/orm-documentation/pull/93&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Mods, this issue can probably be closed.&lt;/p&gt;</comment>
                    <comment id="17981" author="deatheriam" created="Thu, 24 May 2012 19:18:16 +0000"  >&lt;p&gt;Leaving decimal values as strings creates another issue with unnecessary entity updates because old and new same values have different types: old value is always the string type, the new one - decimal. If an old value is &apos;10.00&apos; as a string and the new value is 10 decimal than Doctrine will issue the UPDATE statement for that entity. This is plainly wrong IMHO.&lt;/p&gt;</comment>
                    <comment id="19158" author="verkestk" created="Thu, 20 Dec 2012 00:31:46 +0000"  >&lt;p&gt;There may be other issues around comparison.  I&apos;d rather be comparing numeric types than strings when comparing &quot;decimal&quot; values.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>
</channel>
</rss>