Splitting a number into the integer and decimal parts December 25, 2022 by Tarik Use math.modf: import math x = 1234.5678 math.modf(x) # (0.5678000000000338, 1234.0)