Re: number_format problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



sweet.  thanks for hte correction.  i try, sometimes i fail. :)




                                                                                                                                        
                      "CPT John W.                                                                                                      
                      Holmes"                  To:       "Dillon, John" <JDillon@xxxxxxxxxxxx>, <jeffrey_n_Dyke@xxxxxxxxx>              
                      <holmes072000@cha        cc:       <php-db@xxxxxxxxxxxxx>                                                         
                      rter.net>                Subject:  Re:  number_format problem                                             
                                                                                                                                        
                      11/05/2003 11:56                                                                                                  
                      AM                                                                                                                
                      Please respond to                                                                                                 
                      "CPT John W.                                                                                                      
                      Holmes"                                                                                                           
                                                                                                                                        
                                                                                                                                        




From: <jeffrey_n_Dyke@xxxxxxxxx>
> 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...

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


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux