homepage Welcome to WebmasterWorld Guest from 54.161.166.171
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
Numerical String Splitting
Marked




msg:4060452
 6:28 am on Jan 14, 2010 (gmt 0)

Hi all,

I'm having a little trouble with a few strings. Some of the values are numbers like 78452, 2344, etc.

The trouble is with these numbers it can be hard for some people to read. For example, 4521452662. So I'd like to split the strings into 1000's. For example:

78452 = 78,452
2344 = 2,344
4521452662 = 4,521,452,662

Can anyone show me how to do this?

Thanks in advance.

 

omoutop




msg:4060458
 7:14 am on Jan 14, 2010 (gmt 0)

Take a look at number_format [gr.php.net]

Marked




msg:4060479
 7:58 am on Jan 14, 2010 (gmt 0)

Works like a charm,

Thank you very much indeed :)

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved