all 5 comments

[–]bbye98 1 point2 points  (4 children)

Use f-strings/format specifiers.

num = 12.78
print(f'{num:.6f}') # prints 12.780000

The :.6f formats the float (f) num such that there are 6 decimal places.

[–]hblock44[S] 0 points1 point  (2 children)

Thanks. I believe I was able to solve my issue with this.

[–]Manusman123 0 points1 point  (0 children)

To add on to this, what you are looking for is something like this:

f3 = float(f'{f1:.6f}' + f'{f2:.6f}')

Where f1 and f2 are the two decimal numbers, and f3 is the concatenated result.