def nice_string(string):
    """
    Convert a string of a float created by `float2string_nsf`
    to something nicer.

    i.e.
    - 1.000000 -> 1
    - 1.010000 -> 1.010
    """
    if string.count('.') and len(string.split('.')[1].replace('0', '')) == 0:
        return '{:d}'.format(int(float(string)))
    else:
        olen = len(string)
        newstring = string.rstrip('0')
        if olen > len(newstring):
            string = newstring + '0'
        return string
