$this->load->helper('number');
$formatted_number = format_number(1234.5678, 2, '.', ',');
echo $formatted_number;
- The
helper
function is used to load the Number helper in CodeIgniter. - The
format_number
function formats a number with consistent decimal points, thousands separator, and a specific number of decimal places. - In this example,
1234.5678
is being formatted with 2 decimal places, using a period as the decimal point and a comma as the thousands separator. - The formatted number is then echoed to the screen.
```