Hi again,<br><br>when I use toDouble() I obtain a data in this format:<br><br>(9.5, True)<br><br>When it should be a float 9.50 (cause like I said, is what I have in DB).<br><br>How can I get it 2 decimals positions?<br><br>
Cheers.<br><br><div class="gmail_quote">2010/1/14 Gustavo A. Díaz <span dir="ltr">&lt;<a href="mailto:gustavo.diaz@gmail.com">gustavo.diaz@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Ok, thanks Guys.<br><br><div class="gmail_quote">2010/1/13 Phil Thompson <span dir="ltr">&lt;<a href="mailto:phil@riverbankcomputing.com" target="_blank">phil@riverbankcomputing.com</a>&gt;</span><div><div></div><div class="h5">
<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div>On Wed, 13 Jan 2010 17:56:57 -0300, Gustavo A. Díaz<br>
&lt;<a href="mailto:gustavo.diaz@gmail.com" target="_blank">gustavo.diaz@gmail.com</a>&gt; wrote:<br>
&gt; Hi guys,<br>
&gt;<br>
&gt; When i try to convert a QVariant.toFloat() it says<br>
&gt;<br>
&gt; &quot;&#39;QVariant&#39; object has no attribute &#39;toFloat&#39;&quot;<br>
&gt;<br>
&gt; Should work according to<br>
<a href="http://qt.nokia.com/doc/4.6/qvariant.html#toFloat" target="_blank">http://qt.nokia.com/doc/4.6/qvariant.html#toFloat</a><br>
&gt;<br>
&gt; Is this not implemented in PyQt 4.6.2? (using Qt4.6.0)<br>
<br>
</div>No - it will be in PyQt 4.7.<br>
<div><div></div><div><br>
&gt; Or i am doing something wrong?<br>
&gt;<br>
&gt; In where i am trying to do this:<br>
&gt;<br>
&gt; total = query.record().value(&quot;total&quot;).toFloat()<br>
&gt;<br>
&gt; Where &quot;total&quot; entry in DB (mysql) is decimal(10,2).<br>
&gt;<br>
&gt; Cheers.<br>
<br>
</div></div><font color="#888888">Phil<br>
</font></blockquote></div></div></div><br><br clear="all"><div><div></div><div class="h5"><br>-- <br>Gustavo A. Díaz<br>GDNet Projects<br><a href="http://www.gdnet.com.ar" target="_blank">www.gdnet.com.ar</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Gustavo A. Díaz<br>GDNet Projects<br><a href="http://www.gdnet.com.ar">www.gdnet.com.ar</a><br>