Joomla CMS  3.10.11 (avec JPlatform 13.1 inclus)
Documentation des API du CMS Joomla en version 3.10.11 et du framework Joomla Platform intégré
Référence de la classe JHtmlNumber

Fonctions membres publiques statiques

static bytes ($bytes, $unit='auto', $precision=2, $iec=false)
 

Description détaillée

HTML helper class for rendering numbers.

Depuis
1.6

Documentation des fonctions membres

◆ bytes()

static bytes (   $bytes,
  $unit = 'auto',
  $precision = 2,
  $iec = false 
)
static

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.

Paramètres
string$bytesThe number of bytes. Can be either numeric or suffixed format: 32M, 60K, 12G or 812b
string$unitThe type of unit to return, few special values are: Blank string '' for no unit, 'auto' to choose automatically (default) 'binary' to choose automatically but use binary unit prefix
integer$precisionThe number of digits to be used after the decimal place.
bool$iecWhether to be aware of IEC standards. IEC prefixes are always acceptable in input. When IEC is ON: KiB = 1024 B, KB = 1000 B When IEC is OFF: KiB = 1024 B, KB = 1024 B
Renvoie
string The number of bytes in the proper units.
Depuis
1.6 https://en.wikipedia.org/wiki/Binary_prefix

Références $base, $i, $suffix, et elseif.


La documentation de cette classe a été générée à partir du fichier suivant :