Re: number_format problem

From: Date: Wed, 05 Nov 2003 16:55:20 +0000
Subject: Re: number_format problem
Groups: php.db 
Request: Send a blank email to php-db+get-31437@lists.php.net to get a copy of this message
sweet. thanks for hte correction. i try, sometimes i fail. :) "CPT John W. Holmes" To: "Dillon, John" <JDillon@cantor.co.uk>, <jeffrey_n_Dyke@Keane.com> <holmes072000@cha cc: <php-db@lists.php.net> rter.net> Subject: Re: [PHP-DB] number_format problem 11/05/2003 11:56 AM Please respond to "CPT John W. Holmes" From: <jeffrey_n_Dyke@Keane.com> > could you cast as a float/double before inserting? $number = (double) > $string; > > don't know what would happen to the comma, but i assume it would just get > removed?? Everything after and including the first non-number character would be dropped. So "$12,000.34" would end up as zero. "12,445" would end up as 12, etc... ---John Holmes...

« previous php.db (#31437) next »