import fractions


def fractional(value: str | float) -> str:
    """Return a human readable fractional number.

    The return can be in the form of fractions and mixed fractions.
    There will be some cases where one might not want to show ugly decimal
    places for floats and decimals.

    Pass in a string, or a number or a float, and this function returns
        a string representation of a fraction
        or whole number
        or a mixed fraction

    Examples:
        >>> fractional(0.3)
        '3/10'
        >>> fractional(1.3)
        '1 3/10'
        >>> fractional(float(1/3))
        '1/3'
        >>> fractional(1)
        '1'

    This will always return a string.

    Args:
        value: any number.

    Returns:
        str: human readable number.
    """
    number = float(value)
    whole_number = int(number)
    frac = fractions.Fraction(number - whole_number).limit_denominator(1000)
    numerator = frac.numerator
    denominator = frac.denominator
    if whole_number and not numerator and denominator == 1:
        # this means that an integer was passed in
        # or variants of that integer like 1.0000
        return f"{whole_number:.0f}"
    elif not whole_number:
        return f"{numerator:.0f}/{denominator:.0f}"
    else:
        return f"{whole_number:.0f} {numerator:.0f}/{denominator:.0f}"