How do I get 1324343032.324?
As you can see below, the following do not work:
>>1324343032.324325235 * 1000 / 1000 1324343032.3243253 >>i
You can use the following function to truncate a number to a set number of decimals:
import math def truncate(number, digits) -> float: stepper = 10.0 ** digits return math.trunc(stepper * number) / stepper
Usage:
>>> truncate(1324343032.324325235, 3) 1324343032.324