| | |||||
| ||||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | THREAD STARTER #1 (permalink) |
| Senior Member Join Date: Nov 2005 Location: on a oil rig just off Ireland
Posts: 1,408
![]() ![]() ![]() ![]() ![]() | Splitting thousands Hi, Just wondering if there was a function (pre-built in to PHP , or created) that split thousands by ','s; eg 100000 would be 100,000 950000000 would turn into 950,000,000 I think you get the idea. So is there one that exists? Thanks, TM
__________________ You design in photoshop, I code into valid XHTML/CSS. Professional PSD, PNG or HTML to tableless XHTML/CSS designs. For more info, send me a PM. |
| |
| | #2 (permalink) |
| Buy my domains. Join Date: Feb 2006
Posts: 2,796
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | PHP Code: It reverses the $number and adds a comma after every 3, then reverses it back.
Last edited by Dan Friedman; 05-17-2006 at 12:45 PM.
|
| |
| | THREAD STARTER #3 (permalink) |
| Senior Member Join Date: Nov 2005 Location: on a oil rig just off Ireland
Posts: 1,408
![]() ![]() ![]() ![]() ![]() | Thanks
__________________ You design in photoshop, I code into valid XHTML/CSS. Professional PSD, PNG or HTML to tableless XHTML/CSS designs. For more info, send me a PM. |
| |
| | #4 (permalink) |
| NamePros Regular Join Date: Feb 2006 Location: Montreal, Quebec, Canada
Posts: 324
![]() | There's also number_format if you want something built in PHP Code: |
| |