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])

  • $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.


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

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