JHtmlNumber
class JHtmlNumber
HTML helper class for rendering numbers.
Methods
static
string
bytes(
string $bytes,
string $unit = 'auto',
integer $precision = 2,
bool $iec = false)
Converts bytes to more distinguishable formats such as: kilobytes, megabytes, etc.
Details
static
string
bytes(
string $bytes,
string $unit = 'auto',
integer $precision = 2,
bool $iec = false)
Converts bytes to more distinguishable formats such as: kilobytes, megabytes, etc.
By default, the proper format will automatically be chosen. However, one of the allowed unit types (viz. 'b', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB') may also be used instead. IEC standard unit types ('KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB', 'ZiB', 'YiB') can be used as well.