In article <[EMAIL PROTECTED]>,
Felipe Almeida Lessa <[EMAIL PROTECTED]> wrote:
.
.
.
>math.floor(math.log(x, 10)) + 1
>
>--
>Felipe.
>
... and you're restricting to the positive integers, I take it?
I still have rounding pr
Felipe Almeida Lessa wrote:
> Hmmm, you're right.
>
> math.floor(math.log(x, 10)) + 1
x = 0
--
http://mail.python.org/mailman/listinfo/python-list
Stan Cook wrote:
> Can anyone tell me how to get the length of a number. I know
> len(string) will get the length of a string, but it doesn't like
> len(int). I seem to remember something like %s string. I tried to set
> a variable = to %s int, but that doesn't work
Em Dom, 2006-06-11 às 22:33 +0200, Sybren Stuvel escreveu:
> Felipe Almeida Lessa enlightened us with:
> > To see how many decimal digits it has:
> >
> > import math
> > math.ceil(math.log(i, 10))
>
> That doesn't work properly.
>
> >>> import math
> >>> math.ceil(math.log(1, 10))
> 4
Em Dom, 2006-06-11 às 13:17 -0700, Saketh escreveu:
> Stan Cook wrote:
> > Can anyone tell me how to get the length of a number. I
> > know len(string) will get the length of a string, but it
> > doesn't like len(int). I seem to remember something like %s
> > st
Saketh wrote:
> Stan Cook wrote:
>> Can anyone tell me how to get the length of a number. I
>> know len(string) will get the length of a string, but it
>> doesn't like len(int). I seem to remember something like %s
>> string. I tried to set a variable = to %s in
Em Dom, 2006-06-11 às 20:10 +, Stan Cook escreveu:
> Can anyone tell me how to get the length of a number. I
> know len(string) will get the length of a string, but it
> doesn't like len(int). I seem to remember something like %s
> string. I tried to set a variable = to
Stan Cook wrote:
> Can anyone tell me how to get the length of a number. I
> know len(string) will get the length of a string, but it
> doesn't like len(int). I seem to remember something like %s
> string. I tried to set a variable = to %s int, but that
> doesn't w
Stan Cook wrote:
> Is there a function I've forgotten about to convert an
> integer to a string?
str(value)
--
http://mail.python.org/mailman/listinfo/python-list
Can anyone tell me how to get the length of a number. I
know len(string) will get the length of a string, but it
doesn't like len(int). I seem to remember something like %s
string. I tried to set a variable = to %s int, but that
doesn't work. Is there a function I've for
10 matches
Mail list logo