Jump to content

Archived

This topic is now archived and is closed to further replies.

Tandem

commas in numbers

Recommended Posts

Ok, i'm mysql_query()'ing and then mysql_result()'ing, so that i can print values from my database onto my site. One of these is an integer. I want there to be commas in the integer if possible. For example: instead of 1000000 - it would be 1,000,000.

Is this possible? if so how?

Thanks in advance.

-Tandem

Share this post


Link to post
Share on other sites
There are a couple of ways to do this:

Using SQL
SELECT FORMAT(field_name)
or PHP:
number_format($int)

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.