programming-examples/python/Math/Convert a float to ratio.py
2019-11-15 12:59:38 +01:00

3 lines
93 B
Python

from fractions import Fraction
value = 4.2
print(Fraction(value).limit_denominator())