platform-bible-utils
    Preparing search index...

    Function formatBytes

    • Formats a number according to the locale and formatting options of this NumberFormat object

      Parameters

      • fileSize: number

        Number to format

      • decimals: number = 2

        Number of decimal places to round to

      Returns string

      String representing the given number formatted according to the locale and formatting options of this NumberFormat object

      FormatBytes(1024) => "1 KB"
      
      FormatBytes(1024, 0) => "1 KB"