def val_err_str(val: float, err: float) -> str:
    """
    Get a float representation of a value/error pair and create a string representation
    12.345 +/- 1.23 --> 12.3(12)
    12.345 +/- 0.012 -> 12.345(12
    12345 +/- 654  ---> 12340(650)
    :param val: float representing the value
    :param err: float representing the error in the value
    :return: a string representation of the value/error pair
    """
    err_sig_figs = 2  # future upgrade path is to allow user to set this
    dps = 2 - err_sig_figs
    if err < 10:
        while err < 10.:
            err *= 10
            dps += 1
        err = round(err, 0)
    else:  # err > 10
        while err > 100.:
            err /= 10
            dps -= 1
        err = round(err, 0) * 10 ** (-dps)
    val = round(val, dps)
    return f"{val:.{max(0, dps)}f}({err:.0f})"