def uround(value):
    """Returns a string representation of a value with an uncertainity which
    has been rounded to significant digits based on the uncertainty value.

    Parameters
    ----------
    value : ufloat
        A single ufloat.

    Returns
    -------
    s : string
        A rounded string representation of `value`.

    2.4563752289999+/-0.0003797273827

    becomes

    2.4564+/-0.0004

    This probably doesn't work for weird cases like large uncertainties.

    """
    try:
        nom = value.nominal_value
    except AttributeError:
        s = str(value)
    else:
        uncert = value.std_dev
        if abs(nom) < 1e-15:
            s = '0.0+/-0.0'
        else:
            s = '%.14f' % uncert
            for j, number in enumerate(s):
                if number == '0' or number == '.':
                    pass
                else:
                    digit = j
                    break
            newUncert = round(uncert, digit - 1)
            newUncertStr = ('%.' + str(digit - 1) + 'f') % newUncert
            newNom = round(nom, len(newUncertStr) - 2)
            newNomStr = ('%.' + str(digit - 1) + 'f') % newNom
            diff = len(newUncertStr) - len(newNomStr)
            if diff > 0:
                s = newNomStr + int(diff) * '0' + '+/-' + newUncertStr
            else:
                s = newNomStr + '+/-' + newUncertStr
    return s
