Tim Chase <[EMAIL PROTECTED]> wrote: >def CFloat(value): > try: > value = float(value) > except (ValueError, TypeError): > value = 0 > return value
>>> type(CFloat(None)) <type 'int'> I think you want value = 0.0 . And you might also want to consider what errors you may be masking in silently turning *anything* into a valid number. -- \S -- [EMAIL PROTECTED] -- http://www.chaos.org.uk/~sion/ ___ | "Frankly I have no feelings towards penguins one way or the other" \X/ | -- Arthur C. Clarke her nu becomeþ se bera eadward ofdun hlæddre heafdes bæce bump bump bump
-- http://mail.python.org/mailman/listinfo/python-list