The problem, being inherent in working with floating numbers, isn't
limited to SQL issues. The slight numeric error bit me in the butt after
my original posting when I was finding that converting from decimal
hours to hrs:min was off by a bit. Doing some debugging without
involving SQL showed that
   (tch, tcd) = divmod(2.4,1)
would return (2, .3999999...)
and that when I later converted tcd*60 to an integer, I would get bad
results if I just used
   tcm = int(tcd * 60)
and instead had to use
   tcm = int(round(tcd * 60))

So I've "fixed" things from the app side, but will probably experiment
with changing the field type to decimal from float, in hopes of getting
"true" values in the db (since you can't count on all your apps catching
this).
_______________________________________________
ActivePython mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/activepython

Reply via email to