On Fri, 22 May 2009 21:33:05 +1000
Joel Ross wrote:
> changed it to "float(number)/total*100" and it worked thanks for all
> your help appreciated
I believe operator.truediv function also deserves a mention here, since
line "op.truediv(number, total) * 100" somehow seem to make more sense
to me
On Fri, 2009-05-22 at 09:59 -0400, Dave Angel wrote:
>
> Tim Wintle wrote:
> > On Fri, 2009-05-22 at 13:19 +0200, Andre Engels wrote:
> >
> >> number/total = 998/999 = 0
> >> number/total*100 = 0*100 = 0
> >> float(number/total*100) = float(0) = 0.0
> >>
> >> Change "float(number/total*100)" to
On Fri, 2009-05-22 at 09:59 -0400, Dave Angel wrote:
>
> Tim Wintle wrote:
> > On Fri, 2009-05-22 at 13:19 +0200, Andre Engels wrote:
> >> Change "float(number/total*100)" to "float(number)/total*100" and it
> >> should work:
> >>
> >
> > I'd use:
> >
> > (number * 100.)/total
> >
> > - wor
Dave Angel wrote:
Tim Wintle wrote:
On Fri, 2009-05-22 at 13:19 +0200, Andre Engels wrote:
number/total = 998/999 = 0
number/total*100 = 0*100 = 0
float(number/total*100) = float(0) = 0.0
Change "float(number/total*100)" to "float(number)/total*100" and it
should work:
I'd use:
(n
Tim Wintle wrote:
On Fri, 2009-05-22 at 13:19 +0200, Andre Engels wrote:
number/total = 998/999 = 0
number/total*100 = 0*100 = 0
float(number/total*100) = float(0) = 0.0
Change "float(number/total*100)" to "float(number)/total*100" and it
should work:
I'd use:
(number * 100.)/tota
On Fri, 2009-05-22 at 13:19 +0200, Andre Engels wrote:
> number/total = 998/999 = 0
> number/total*100 = 0*100 = 0
> float(number/total*100) = float(0) = 0.0
>
> Change "float(number/total*100)" to "float(number)/total*100" and it
> should work:
I'd use:
(number * 100.)/total
- works because
Andre Engels wrote:
On Fri, May 22, 2009 at 12:35 PM, Joel Ross wrote:
Im using 2.6 python and when running this
class progess():
def __init__(self, number, total, char):
percentage = float(number/total*100)
percentage = int(round(percentage))
char = char * percenta
On Fri, May 22, 2009 at 12:35 PM, Joel Ross wrote:
> Im using 2.6 python and when running this
>
> class progess():
>
> def __init__(self, number, total, char):
>
> percentage = float(number/total*100)
> percentage = int(round(percentage))
> char = char * percentage
>
> Im using 2.6 python and when running this
>
> class progess():
>
> def __init__(self, number, total, char):
>
> percentage = float(number/total*100)
> percentage = int(round(percentage))
> char = char * percentage
> print char
>
> progess(1
Andre Engels wrote:
On Fri, May 22, 2009 at 11:17 AM, Joel Ross wrote:
Hi all,
I have this piece of code
class progess():
def __init__(self, number, char):
total = number
percentage = number
while percentage > 0 :
percentage = int(number/total*100)
Joel Ross wrote:
Hi all,
I have this piece of code
class progess():
def __init__(self, number, char):
total = number
percentage = number
while percentage > 0 :
percentage = int(number/total*100)
number-=1
char+="*"
p
On Fri, May 22, 2009 at 11:17 AM, Joel Ross wrote:
> Hi all,
>
> I have this piece of code
>
> class progess():
>
> def __init__(self, number, char):
>
> total = number
> percentage = number
> while percentage > 0 :
> percentage = int(number/total*100)
>
On Fri, May 22, 2009 at 2:47 PM, Joel Ross wrote:
> Hi all,
>
> I have this piece of code
>
> class progess():
>
> def __init__(self, number, char):
>
> total = number
> percentage = number
> while percentage > 0 :
> percentage = int(number/total*100)
>
13 matches
Mail list logo