toggers
05-27-2006, 08:49 AM
Hi, this is probably a really simple problem for you guys, but i've only just started programming in python, and i've come across this problem. i'm trying to calculate the sales cost of a product by getting values from two text boxes and doing that maths equation to display the answer in a label
I'm using the program "Eric" in python to program the file, and i'm using "PyQT to design the form.
This is my code (under the function "calculate sales cost):
f = str(self.txtOriginal_cost.text())
g = str(self.txtDiscount.text.text())
h = float(f - (f / 100 * g))
self.lblCost.setText(h)
_________________________________________________________________
If someone could give me an answer as soon as possible that would be great!
Thanks
I'm using the program "Eric" in python to program the file, and i'm using "PyQT to design the form.
This is my code (under the function "calculate sales cost):
f = str(self.txtOriginal_cost.text())
g = str(self.txtDiscount.text.text())
h = float(f - (f / 100 * g))
self.lblCost.setText(h)
_________________________________________________________________
If someone could give me an answer as soon as possible that would be great!
Thanks