• Format a file size in a human-like format. e.g. 42GB

    The default for Nextcloud is like Windows using binary sizes but showing decimal units, meaning 1024 bytes will show as 1KB instead of 1KiB or like on Apple 1.02 KB

    Parameters

    • size: string | number

      in bytes

    • skipSmallSizes: boolean = false

      avoid rendering tiny sizes and return '< 1 KB' instead

    • binaryPrefixes: boolean = false

      True if size binary prefixes like KiB should be used as per IEC 80000-13

    • base1000: boolean = false

      Set to true to use base 1000 as per SI or used by Apple (default is base 1024 like Linux or Windows)

    Returns string