On Oct 29, 2010, at 6:08 PM, Ed Leafe wrote:

>>> Try typing 4.50 and tabbing off the spinner. Until I changed the floats to 
>>> decimals, 
>>> it would revert back to the oldval.
>> 
>>      OK, I hadn't tried that. Yes, it reverts if you type the value 
>> directly. Any clue as to why? Is it the imprecision of floats?
> 
>       Actually, I dug a little deeper, and it's due to the inability to 
> compare Decimal and float values in versions of Python earlier than 2.7. In 
> 2.6 and earlier, you get the following:
> 
> d = decimal.Decimal("999.0")
> f = 4.50
> print f > d
> => True


        I added some simple type conversion, and now it works even with your 
example.



-- Ed Leafe




_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message: 
http://leafe.com/archives/byMID/[email protected]

Reply via email to