Module: alfresco/core/FileSizeMixin

alfresco/core/FileSizeMixin

Author:
  • Dave Draper
License:
Source:

Members

BYTES_GB :number

Type:
  • number
Default Value:
  • 1073741824
Source:

BYTES_KB :number

Type:
  • number
Default Value:
  • 1024
Source:

BYTES_MB :number

Type:
  • number
Default Value:
  • 1048576
Source:

Methods

formatFileSize(fileSize, decimalPlaces) → {string}

Converts a file size in bytes to human readable form
Parameters:
Name Type Argument Default Description
fileSize number File size in bytes
decimalPlaces int <optional>
0 number of decimal places
Source:
Returns:
The file size in a readable form, i.e 1.2mb
Type
string