Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Formatting numerical values with ','s 1

Status
Not open for further replies.

Shrum

Programmer
May 17, 2002
122
US
This is a followup question to the decimal point post.

Is there a way to tell any numeric output function for format numbers with ',': 1000000 = 1,000,000?

TIA

=============================
Sean Shrum
Shrum Consulting
 
well from the absence of any answers from this forum's masters i can take it that its not possible with databse. why not use the front end to do this...

Known is handfull, Unknown is worldfull
 
I was hoping to avoid having to code something into the front-end (I'm using a CMS that I wrote)....hoping to avoid making changes in both my Perl and PHP scripts to deal with this and have SQL handle it.

My interum search found nothing so my guess is that it's just not possible to do via SQL.

Oh well...win some...lose some.

=============================
Sean Shrum
Shrum Consulting
 
FORMAT(X,D)
Formats the number X to a format like '#,###,###.##', rounded to D decimals. If D is 0, the result will have no decimal point or fractional part:

mysql> SELECT FORMAT(12332.123456, 4);
-> '12,332.1235'
mysql> SELECT FORMAT(12332.1,4);
-> '12,332.1000'
mysql> SELECT FORMAT(12332.2,0);
-> '12,332'


rudy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top