Function bytesToHumanFileSize

  • Format bytes as human-readable text.

    See

    https://stackoverflow.com/a/14919494/4971138

    Parameters

    • bytes: number

      Number of bytes.

    • si: boolean = false

      True to use metric (SI) units, aka powers of 1000. False to use binary (IEC), aka powers of 1024.

    • dp: number = 1

      Number of decimal places to display.

    Returns string