Number helper in codeigniter

Number Helper

The Number Helper file contains functions that help you work with numeric data.

Loading this Helper

This helper is loaded using the following code:

Available Functions

The following functions are available:

byte_format($num[, $precision = 1])

Parameters:
  • $num (mixed) – Number of bytes
  • $precision (int) – Floating point precision
  • Returns:Formatted data size string
    Return type:string

    Formats numbers as bytes, based on size, and adds the appropriate suffix.

    Examples:

    An optional second parameter allows you to set the precision of the result:

    Note
    The text generated by this function is found in the following language file: language//number_lang.php