def FloatToString(f):
    num_digits = 6
    g = f
    while (abs(g) > 1.0):
        g *= 0.1
        num_digits += 1
    format_str = '%.{0}g'.format(num_digits)
    return (format_str % f)
def FloatToString(f):
    num_digits = 6
    g = f
    while (abs(g) > 1.0):
        g *= 0.1
        num_digits += 1
    format_str = '%.{0}g'.format(num_digits)
    return (format_str % f)