How to insert comas into a number? - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: How to insert comas into a number? (/showthread.php?tid=10539) |
How to insert comas into a number? - El Forum - 08-04-2008 [eluser]daulex[/eluser] (I need this for an old project that is not based on CI) I have no clue how to do this. The system: The user can type in a number, after numerous formulas and functions it changes and gets displayed on a different page, where it shows up like 10000 or 200 or 6020400 or any number for that matter, I would need numbers that are over 3 digits long to be parsed, so instead of 1000 it would show 1,000 or 1,000 and instead of for example 9284155213 it would show 9,284,155,213. I hope you get the idea... Does anyone know any easy way to do this? (I don't really mind if it's php or javascript...) Thanks How to insert comas into a number? - El Forum - 08-04-2008 [eluser]xwero[/eluser] you can use the php number_format function to do what you want. |