Convert '165.0' to int

Hrvoje Niksic hniksic at
Fri Jul 22 08:42:04 EDT 2011

Frank Millman <frank at> writes:

> int(float(x)) does the job, and I am happy with that. I was just
> asking if there were any alternatives.

int(float(s)) will corrupt integers larger than 2**53, should you ever
need them.  int(decimal.Decimal(s)) works with numbers of arbitrary

More information about the Python-list mailing list