Contact: aviboots(AT)netvision.net.il
40,904 questions
53,356 answers
573 users
import math f = 234.872 fraction, whole = math.modf(f) print(whole) print(fraction) ''' run: 234.0 0.8720000000000141 '''
import math f = 234.872 whole = math.floor(f) fraction = f - whole print(whole) print(fraction) ''' run: 234.0 0.8720000000000141 '''
f = 234.872 whole = int(f) fraction = f - int(f) print(whole) print(fraction) ''' run: 234 0.8720000000000141 '''