Re: [PHP-DB] number_format problem

2003-11-05 Thread CPT John W. Holmes
From: <[EMAIL PROTECTED]> > sweet. thanks for hte correction. i try, sometimes i fail. :) But trying is half the battle. GI JOE! ---John Holmes... -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] number_format problem

2003-11-05 Thread jeffrey_n_Dyke
cc: <[EMAIL PROTECTED]> rter.net> S

Re: [PHP-DB] number_format problem

2003-11-05 Thread CPT John W. Holmes
From: "Peter Beckman" <[EMAIL PROTECTED]> > On Wed, 5 Nov 2003, Dillon, John wrote: > > I use this: > > $x['funds'] = (int)preg_replace("/[\$,]/","",$x['funds']); > > where $x['funds'] contains something like $3,249,555.32, and the end > result is an int of 3249555. I drop the cents... yo

Re: [PHP-DB] number_format problem

2003-11-05 Thread CPT John W. Holmes
From: <[EMAIL PROTECTED]> > 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" w

Re: [PHP-DB] number_format problem

2003-11-05 Thread CPT John W. Holmes
From: "Dillon, John" <[EMAIL PROTECTED]> > I want to show a number from a database in the format x,xxx.00 in a > textfield, then if it is changed by the user I want to post the value of the > number to a decimal field. However, once you number_format the number it > becomes a string, and numbers

RE: [PHP-DB] number_format problem

2003-11-05 Thread Peter Beckman
On Wed, 5 Nov 2003, Aleks @ USA.net wrote: > Great answer... One question though, how would you convert it back to > X,xxx.00 format?? number_format($variable,2); --- Peter Beckman

RE: [PHP-DB] number_format problem

2003-11-05 Thread Aleks @ USA.net
Great answer... One question though, how would you convert it back to X,xxx.00 format?? Thanks Aleks -Original Message- From: Peter Beckman [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 05, 2003 10:48 AM To: [EMAIL PROTECTED] Subject: Re: [PHP-DB] number_format problem On Wed

Re: [PHP-DB] number_format problem

2003-11-05 Thread Peter Beckman
On Wed, 5 Nov 2003, Dillon, John wrote: > I want to show a number from a database in the format x,xxx.00 in a > textfield, then if it is changed by the user I want to post the value of the > number to a decimal field. However, once you number_format the number it > becomes a string, and numbers l

Re: [PHP-DB] number_format problem

2003-11-05 Thread jeffrey_n_Dyke
[EMAIL PROTECTED] o.uk>cc: Subject: [PHP-DB] n

[PHP-DB] number_format problem

2003-11-05 Thread Dillon, John
I want to show a number from a database in the format x,xxx.00 in a textfield, then if it is changed by the user I want to post the value of the number to a decimal field. However, once you number_format the number it becomes a string, and numbers like 3,379.90 give a value of 3 when posted to the