Fix Python – How to get numbers after decimal point?

Question

Asked By – Alex Gordon

How do I get the numbers after a decimal point?

For example, if I have 5.55, how do i get .55?

Now we will see solution for issue: How to get numbers after decimal point?


Answer

An easy approach for you:

number_dec = str(number-int(number))[1:]

This question is answered By – lllluuukke

This answer is collected from stackoverflow and reviewed by FixPython community admins, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0