[PyQt] QVariant.toFloat()

Andreas Pakulat apaku at gmx.de
Thu Jan 14 12:55:20 GMT 2010


On 14.01.10 09:36:53, Gustavo A. Díaz wrote:
> 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).

Why should it? Its the same value in both cases.

> How can I get it 2 decimals positions?

By adjusting your display-widget to format floating point numbers that way
(I think QString::arg() allows to do that).

Andreas

-- 
Try to relax and enjoy the crisis.
		-- Ashleigh Brilliant


More information about the PyQt mailing list