Avell Diroll <[EMAIL PROTECTED]> writes:
> I have to disagree: 'mb' should stand for "milli-bit" :)
Yes, you're right. My "metre-bit" was wrong.
--
\ "Whenever you read a good book, it's like the author is right |
`\ there, in the room talking to you, which is why I don't like to |
Ben Finney wrote:
> The symbol for "bit" is 'b'. The symbol for "byte" is 'B'. 'kb' is
> 'kilobit', i.e. 1000 bits. 'mb' is a "metre-bit", a combination of two
> units. And so on. The SI units have definitions that are only muddied
> by misusing them this way.
I have to disagree: 'mb' should stand
Haha, you guys. Use it however you want. But trust me, if you put MiB
and GiB instead of the more-common mb and gb [MB and GB] in your
applications, your users will probably have a harder time
understanding what you mean.
--
http://mail.python.org/mailman/listinfo/python-list
samuraisam <[EMAIL PROTECTED]> writes:
> Quick file size formatting for all those seekers out there...
>
> import math
>
> def filesizeformat(bytes, precision=2):
> """Returns a humanized string for a given amount of bytes"""
> bytes = int(bytes)
> if bytes is 0:
> return '0byt
On Jun 13, 12:48 am, [EMAIL PROTECTED] wrote:
> On Jun 12, 8:47 pm, samuraisam <[EMAIL PROTECTED]> wrote:
>
>
>
> > Quick file size formatting for all those seekers out there...
>
> > import math
>
> > def filesizeformat(bytes, precision=2):
> > """Returns a humanized string for a given amount
On Jun 13, 12:48 am, [EMAIL PROTECTED] wrote:
> On Jun 12, 8:47 pm, samuraisam <[EMAIL PROTECTED]> wrote:
>
>
>
> > Quick file size formatting for all those seekers out there...
>
> > import math
>
> > def filesizeformat(bytes, precision=2):
> > """Returns a humanized string for a given amount
On Jun 12, 8:47 pm, samuraisam <[EMAIL PROTECTED]> wrote:
> Quick file size formatting for all those seekers out there...
>
> import math
>
> def filesizeformat(bytes, precision=2):
> """Returns a humanized string for a given amount of bytes"""
> bytes = int(bytes)
> if bytes is 0:
>
samuraisam <[EMAIL PROTECTED]> wrote:
>
>Quick file size formatting for all those seekers out there...
>
>import math
>
>def filesizeformat(bytes, precision=2):
>"""Returns a humanized string for a given amount of bytes"""
>bytes = int(bytes)
>if bytes is 0:
>return '0bytes'
>
On Jun 12, 8:47 pm, samuraisam <[EMAIL PROTECTED]> wrote:
> Quick file size formatting for all those seekers out there...
>
> import math
>
> def filesizeformat(bytes, precision=2):
> """Returns a humanized string for a given amount of bytes"""
> bytes = int(bytes)
> if bytes is 0:
>
Quick file size formatting for all those seekers out there...
import math
def filesizeformat(bytes, precision=2):
"""Returns a humanized string for a given amount of bytes"""
bytes = int(bytes)
if bytes is 0:
return '0bytes'
log = math.floor(math.log(bytes, 1024))
retu
10 matches
Mail list logo