Welcome to WebmasterWorld Guest from 54.145.13.215

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

Numerical String Splitting

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

Junior Member

5+ Year Member

joined:June 30, 2009
posts:74
votes: 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.

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

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Oct 15, 2004
posts:941
votes: 0


Take a look at number_format [gr.php.net]
7:58 am on Jan 14, 2010 (gmt 0)

Junior Member

5+ Year Member

joined:June 30, 2009
posts:74
votes: 0


Works like a charm,

Thank you very much indeed :)