You can use the round() function to truncate decimal places of a float to your desired number.
E.g.
>>> round(32.2345675465,2)32.23>>> round(21.3567885,3)21.357