ViewHelper Documentation


Formats an integer with a byte count into human-readable form.

= Examples =

{fileSize -> f:format.bytes()} 123 KB // depending on the value of {fileSize}

{fileSize -> f:format.bytes(decimals: 2, decimalSeparator: '.', thousandsSeparator: ',')} 1,023.00 B // depending on the value of {fileSize}

You may provide an own set of units, like this: B,KB,MB,GB,TB,PB,EB,ZB,YB {fileSize -> f:format.bytes(units: '{f:translate(\'viewhelper.format.bytes.units\', \'fluid\')}' 123 KB // depending on the value of {fileSize}


value anySimpleType

The incoming data to convert, or NULL if VH children should be used

decimals anySimpleType

The number of digits after the decimal point

decimalSeparator string

The decimal point character

thousandsSeparator string

The character for grouping the thousand digits

units string

comma separated list of available units, default is LocalizationUtility::translate('viewhelper.format.bytes.units', 'fluid')

ViewHelper Resources

Schema Resources