Hi,

Was wondering if anyone could help me with this little problem I'm having. I'd like to have a comma separator after every 3 digits. E.g "3,000,000". How would i go about this?

Thanks in advance

Recommended Answers

I'm sure this is only useful at the front end. Therefore you should have a piece of code to insert the commas at the front end.

Which would either be a case of converting the number to a string and putting a comma at every three characters or using …

Jump to Post

All 3 Replies

I'm sure this is only useful at the front end. Therefore you should have a piece of code to insert the commas at the front end.

Which would either be a case of converting the number to a string and putting a comma at every three characters or using a trick with the modulous operator and division.

haha... had a feeling you'd be the one to reply, but yet, I'm still glad! ok, so how would i go about inserting the code, cause im currently using a query to fetch the data. Should i use php? if so, any good resources that might help?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.