Hi again,

when I use toDouble() I obtain a data in this format:

(9.5, True)

When it should be a float 9.50 (cause like I said, is what I have in DB).

How can I get it 2 decimals positions?

Cheers.

2010/1/14 Gustavo A. Díaz <[email protected]>

> Ok, thanks Guys.
>
> 2010/1/13 Phil Thompson <[email protected]>
>
> On Wed, 13 Jan 2010 17:56:57 -0300, Gustavo A. Díaz
>> <[email protected]> wrote:
>> > Hi guys,
>> >
>> > When i try to convert a QVariant.toFloat() it says
>> >
>> > "'QVariant' object has no attribute 'toFloat'"
>> >
>> > Should work according to
>> http://qt.nokia.com/doc/4.6/qvariant.html#toFloat
>> >
>> > Is this not implemented in PyQt 4.6.2? (using Qt4.6.0)
>>
>> No - it will be in PyQt 4.7.
>>
>> > Or i am doing something wrong?
>> >
>> > In where i am trying to do this:
>> >
>> > total = query.record().value("total").toFloat()
>> >
>> > Where "total" entry in DB (mysql) is decimal(10,2).
>> >
>> > Cheers.
>>
>> Phil
>>
>
>
>
> --
> Gustavo A. Díaz
> GDNet Projects
> www.gdnet.com.ar
>



-- 
Gustavo A. Díaz
GDNet Projects
www.gdnet.com.ar
_______________________________________________
PyQt mailing list    [email protected]
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Reply via email to