Helper number does not format decimal - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28) +--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30) +--- Thread: Helper number does not format decimal (/showthread.php?tid=76423) |
Helper number does not format decimal - PHS - 05-11-2020 Hello people! Was there an update to the helper number? After I updated CI4 to the latest version (4.0.3) it is no longer formatting decimal numbers! Exemple: PHP Code: $number = 2.55; Result: PHP Code: US$ 3 RE: Helper number does not format decimal - MatheusCastro - 06-29-2020 I have the same problem. Any solution? Solved: number_to_currency($number, 'USD', null, 2); RE: Helper number does not format decimal - captain-sensible - 07-03-2020 number_to_currency($number, 'USD', null, 2); yes that works RE: Helper number does not format decimal - MatheusCastro - 07-03-2020 (07-03-2020, 11:54 AM)captain-sensible Wrote: just tried this: This way it rounds the decimal places. Thing I needed. PHP Code: <?php This function receives the $fraction, which we can add the number of decimal places we need. So, resolved. [SOLVED]RE: Helper number does not format decimal - captain-sensible - 07-03-2020 yes i posted then read the small text 'solved' so went to delete thread- you must have beaten me to it ! |