def error_formatting(value: float, unc: float, prec: int) -> str:
    """Take a value and its uncertainty and express is as a formatted LaTeX string.

    Scientific notation is assumed. As an example, if value is 0.0002153 and uncertainty
    is 0.00002, at a precision of 3 the formated string would be:
    '$(2.15 \pm 0.20) \times 10^{-4}$'

    :param value: Value to be given
    :param unc: Uncertaintiy of the value
    :param prec: Significant digits.

    :return: LaTeX formatted string, see example above.
    """
    value_exp_not = f"{value:E}"
    exponent = int(value_exp_not.split("E")[1])
    value_str = f"{value*10**(-exponent):.{prec}f}"
    unc_str = f"{unc*10**(-exponent):.{prec}f}"
    if exponent != 0:
        ret_str = f"$({value_str} \pm {unc_str}) \\times 10^{{{exponent}}}$"
    else:
        ret_str = f"${value_str} \pm {unc_str}$"
    return ret_str