The expression int(float(s))
mentioned by others is the best if you want to truncate the value. If you want rounding, using int(round(float(s))
if the round algorithm matches what you want (see the round documentation), otherwise you should use Decimal
and one if its rounding algorithms.