how about this solution: def printDecimal(number): if (number < 0): print number - int(number) else: print int(number) - number
-----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Grant Edwards Sent: Thursday, March 23, 2006 5:11 PM To: python-list@python.org Subject: Re: Remove integer from float number On 2006-03-23, Arne Ludwig <[EMAIL PROTECTED]> wrote: > With that terse description and the subject line I would interpret the > OP like so: > >>>> print re.sub(".*\.",".","0.666") > .666 >>>> print re.sub(".*\.",".","123.666") > .666 Or if you're allergic to regular expressions: >>> print "." + "0.666".split(".")[-1] .666 >>> print "." + "123.666".split(".")[-1] .666 >>> -- Grant Edwards grante Yow! Yow! It's a hole at all the way to downtown visi.com Burbank! -- http://mail.python.org/mailman/listinfo/python-list -- http://mail.python.org/mailman/listinfo/python-list