This is actually just a Python quirk: In Python 2.x, the / operator always returns an integer when both operands are integers, e.g. (5 / 2) returns 2, not 2.5. The solution is to simply make one or both operands a float:
percent = float(x) / y * 100 # x/y as a percentage If you want your percent value to be an integer: percent = int(float(x) / y * 100) # x/y as a percentage On Feb 21, 3:45 am, Hassan Alnatour <halna...@gardeniatelco.com> wrote: > Dear All , > > i have two variables am using : > > 1 - myfull >>> returns 3 > 2 - myfull 2 >>> returns 5 > > so what am trying to do is myfull1 = (myfull / myfull2)* 100 , so i > can get a percent >>> {{=myfull1%}} but i keep geting 0 it should be > 60%