from typing import Union


def sround(
    x: Union[int, float, str], ndigits: int = 3, default: float = 0.0
) -> str:
    """Round the number and return as a string.

    Args:
        x (int|float|str): Number to format.
        ndigits (int): Number of digits to enforce.
        default (float): Default value if rounding fails.

    Returns:
        str: Rounded string representation.
    """
    try:
        x = round(float(x), ndigits=ndigits)
    except ValueError:
        x = default

    return "{{:.{}f}}".format(ndigits).format(x)