Skip to content

Instantly share code, notes, and snippets.

@jmoiron
Created March 28, 2019 01:55
Show Gist options
  • Select an option

  • Save jmoiron/0f4b7c54db9a72b7e35ed0536265cfdc to your computer and use it in GitHub Desktop.

Select an option

Save jmoiron/0f4b7c54db9a72b7e35ed0536265cfdc to your computer and use it in GitHub Desktop.

Revisions

  1. jmoiron created this gist Mar 28, 2019.
    8 changes: 8 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,8 @@
    >>> humanize.naturalsize(1<<30)
    '1.1 GB'

    >>> humanize.naturalsize(1<<30, binary=True)
    '1.0 GiB'

    humanize.naturalsize(1<<30, gnu=True)
    '1.0G'