I want to aproximate my result of an operation to the same amount of decimals of my input number.
inclined_plane_f = float(input('F '))
inclined_plane_r = float(input('R '))
inclined_plane_h = float(input('h '))
inclined_plane_l = float(input('L '))
check = cmath.sqrt(inclined_plane_l ** 2 - inclined_plane_h ** 2)
if inclined_plane_l == cmath.sqrt(check ** 2 + inclined_plane_h ** 2):
pass
else:
raw_inclined_plane_l = cmath.sqrt(check ** 2 + inclined_plane_h ** 2)
dec = len(str(inclined_plane_l).split('.')[1])
I want to make raw_inclined_plane_l to have the same amout of decimals as inclined_plane_l (the input) aproximating it to check if the number of the input was correct.