How to round number to constant decimal
Try this if you really need unnecessary zeros:
def format_floats(reference, values):
    formatted_values = []
    for i in range(len(values)):
        length = len(str(reference)[str(reference).find("."):])-1
        new_float = str(round(values[i], length))
        new_float += "0"*(len(str(reference))-len(new_float))
        formatted_values.append(new_float)

    return formatted_values

if __name__ == '__main__':

    reference = 0.12345
    values = [1.04, 2.045, 2.0]

    print(format_floats(reference, values))


output: ['1.04000', '2.04500', '2.00000']
I want to use "math.sqrt" and my output should have 4 decimal after point even for numbers like "4". is there any func or way?!
I used "round(num_sqrt, 4)" but it didn't work.
my input is like:
1
2
3
19
output must be:
1.0000
1.4142
1.7320
4.3588
and my output is:
1.0
1.4142
1.7320
4.3588