JHtmlNumber::bytes
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 may also be used instead.
Signature
public function bytes(integer
$bytes,
[string
$unit = 'auto',
[integer
$precision = 2]] )
Parameters
-
$bytes
- The number of bytes.
-
$unit
- The type of unit to return.
-
$precision
- The number of digits to be used after the decimal place.
Returns
- string
- The number of bytes in the proper units.
Tasks
Line | Task |
---|---|
58 | Allow conversion of units where $bytes = '32M'. |