a=123.45324
is there a function that will return just 123?
a=123.45324
is there a function that will return just 123?
If you want both the decimal and non-decimal part:
def split_at_decimal(num):
integer, decimal = (int(i) for i in str(num).split("."))
return integer, decimal
And then:
>>> split_at_decimal(num=5.55)
(5, 55)