Functions | |
def | convert_to_mixed_fraction (number, denominators) |
def mycroft.util.lang.format_common.convert_to_mixed_fraction | ( | number, | |
denominators | |||
) |
Convert floats to components of a mixed fraction representation Returns the closest fractional representation using the provided denominators. For example, 4.500002 would become the whole number 4, the numerator 1 and the denominator 2 Args: number (float): number for convert denominators (iter of ints): denominators to use, default [1 .. 20] Returns: whole, numerator, denominator (int): Integers of the mixed fraction
Definition at line 19 of file format_common.py.