$_view
$_view : \Horde_View
The parent view invoking the helper.
View helpers for numbers.
All helpers hold a link back to the instance of the view. The undefined property handlers (get()/call() methods) are used to mix helpers together, effectively placing them on the same pane of glass (the view) and allowing any helper to call any other.
$_view : \Horde_View
The parent view invoking the helper.
__construct(\Horde_View $view)
Creates a helper for $view.
\Horde_View | $view | The view to help. |
numberToHumanSize(integer|float $size, $precision = 1) : string
Formats the bytes in $size into a more understandable representation.
Useful for reporting file sizes to users. This method returns NULL if $size cannot be converted into a number. You can change the default precision of 1 in $precision.
$this->numberToHumanSize(123) => 123 Bytes $this->numberToHumanSize(1234) => 1.2 KB $this->numberToHumanSize(12345) => 12.1 KB $this->numberToHumanSize(1234567) => 1.2 MB $this->numberToHumanSize(1234567890) => 1.1 GB $this->numberToHumanSize(1234567890123) => 1.1 TB $this->numberToHumanSize(1234567, 2) => 1.18 MB
integer|float | $size | Size to format. |
$precision |
Formatted size value.