def number_to_str(v: float, int_format: str='d', float_format: str='16.8e'
    ) ->str:
    """Convert int or float to string."""
    if isinstance(v, int):
        return ('{:' + int_format + '}').format(v)
    elif isinstance(v, float):
        return ('{:' + float_format + '}').format(v)
    else:
        raise TypeError(v)
