from typing import Union
import decimal


def clean_duty_sentence(value: Union[str, int, float]) -> str:
    """Given a value, return a string representing a duty sentence taking into
    account that the value may be storing simple percentages as a number
    value."""
    if isinstance(value, float) or isinstance(value, int):
        # This is a percentage value that Excel has
        # represented as a number.
        decimal.getcontext().prec = 3
        decimal.getcontext().rounding = decimal.ROUND_DOWN
        return f"{decimal.Decimal(str(value)):.3%}"
    else:
        # All other values will appear as text.
        return str(value)