this snippet works properly expect for the fact that the precision is not set. Outputs have many decimals after the comma, I want it to be set to 2. Tried many ways to set it but none of them have worked. Any ideas how I can reach this?
Many thanks.
def getExponential():
x2 = entry2.get()
label2 = Label(window, text=float(x2)*float(x2))
canvas1.create_window(350, 100, window=label2)
button2 = Button(text='Get the Exponential', command=getExponential)
canvas1.create_window(240, 100, window=button2)