def METHOD_NAME(val: Any, output_format: str = "standard", errors: str = "coarse") -> Any:
    """
    Reformat a number string with proper separators and whitespace.
    Parameters
    ----------
    val
           The value of number string.
    output_format
           If output_format = 'compact', return string without any separators or whitespace.
           If output_format = 'standard', return string with proper separators and whitespace.
           Note: in the case of handelsregisternummer,
           the compact format is the same as the standard one.
    """
    val = str(val)
    result: Any = []
    if val in NULL_VALUES:
        return [np.nan]
    if not validate_de_handelsregisternummer(val):
        if errors == "raise":
            raise ValueError(f"Unable to parse value {val}")
        error_result = val if errors == "ignore" else np.nan
        return [error_result]
    if output_format in {"compact", "standard"}:
        result = [handelsregisternummer.compact(val)] + result
    return result