RE: [PHP-DB] commas

2003-07-17 Thread Gary . Every
Check out the php function number_format($field,0)

Gary Every
Sr. UNIX Administrator
Ingram Entertainment
(615) 287-4876
Pay It Forward
mailto:[EMAIL PROTECTED]
http://accessingram.com


 -Original Message-
 From: Chris Mach [mailto:[EMAIL PROTECTED]
 Sent: Thursday, July 17, 2003 7:43 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] commas
 
 
 Is there a function that will strip or add commas?
 
 I'm trying to do calculations with attendance numbers of 
 football games...
 for example:  33,153
 
 right now I don't have a comma for the numbers in the 
 database. So the above
 example is 33153 in my database. If I put the comma in, when 
 I try to do
 calculations with php it sees it as 33 instead of 33,153.
 
 So is there a way to add that comma afterwards? Perhaps a 
 string function at
 will put the comma in after the first 3 characters?
 
 Thanks
 
 
 
 
 
 -- 
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 


RE: [PHP-DB] commas

2003-07-17 Thread Edward Peloke
format_number() should do what you want

http://us3.php.net/manual/en/function.number-format.php

Eddie

-Original Message-
From: Chris Mach [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 17, 2003 8:43 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] commas


Is there a function that will strip or add commas?

I'm trying to do calculations with attendance numbers of football games...
for example:  33,153

right now I don't have a comma for the numbers in the database. So the above
example is 33153 in my database. If I put the comma in, when I try to do
calculations with php it sees it as 33 instead of 33,153.

So is there a way to add that comma afterwards? Perhaps a string function at
will put the comma in after the first 3 characters?

Thanks





--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP-DB] commas

2003-07-17 Thread Edward Peloke
sorry, I am a backwards today...number_format()

-Original Message-
From: Edward Peloke [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 17, 2003 9:01 AM
To: Chris Mach; [EMAIL PROTECTED]
Subject: RE: [PHP-DB] commas


format_number() should do what you want

http://us3.php.net/manual/en/function.number-format.php

Eddie

-Original Message-
From: Chris Mach [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 17, 2003 8:43 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] commas


Is there a function that will strip or add commas?

I'm trying to do calculations with attendance numbers of football games...
for example:  33,153

right now I don't have a comma for the numbers in the database. So the above
example is 33153 in my database. If I put the comma in, when I try to do
calculations with php it sees it as 33 instead of 33,153.

So is there a way to add that comma afterwards? Perhaps a string function at
will put the comma in after the first 3 characters?

Thanks





--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php