jmoiron/humanize — pull request #13 by joemaller (2013-08-11 03:23:24+00:00)
Title: Added format parameter to naturalsize

This adds a formatting option so `naturalsize ` can return values like `3.14 MB` or `3M` if desired. Default behavior is unchanged.

I based this on code already in `humanize.intword`. Formatting only applies to the number, not the filesize suffix.

Several additional tests were added to `FileSizeTestCase`; all tests passed under Python 3.3.2 and 2.7.5