Re: 'filesize' patch for humanize

2006-08-02 Thread Gary Wilson
Just thought I might share a size converter I wrote a while back... def bytesToHumanReadable(bytes, binary=True, precision=1): """Convert bytes to a human-readable size. Given a size in bytes, this function converts it and uses the largest suffix possible that does not result in a siz

Re: 'filesize' patch for humanize

2006-08-01 Thread Jay Parlar
Oh jeez, I just noticed the 'filesizeformat' filter... Well, there's 5 minutes of my life I'll never get back :) Jay P. On 8/1/06, Jay Parlar <[EMAIL PROTECTED]> wrote: > I just added a patch (http://code.djangoproject.com/ticket/2466) that > adds a 'filesize' filter, which returns filesizes (f

'filesize' patch for humanize

2006-08-01 Thread Jay Parlar
I just added a patch (http://code.djangoproject.com/ticket/2466) that adds a 'filesize' filter, which returns filesizes (from get_XXX_size) in a human friendly way. It's trivially simple, but I thought it might be useful to others. Jay P. --~--~-~--~~~---~--~~ Y