Re: number_format problem

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

 



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??

just a guess/thought
Jeff


                                                                                                                                        
                      "Dillon, John"                                                                                                    
                      <JDillon@xxxxxxxx        To:       php-db@xxxxxxxxxxxxx                                                           
                      o.uk>                    cc:                                                                                      
                                               Subject:   number_format problem                                                 
                      11/05/2003 10:29                                                                                                  
                      AM                                                                                                                
                                                                                                                                        
                                                                                                                                        




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 database, which is hinted at in the notes on number_format.  I suppose
I
need a string to number function - can someone tell me what this might be
called please?

Regards,

John








































                                           http://www.cantor.com
CONFIDENTIAL: This e-mail, including its contents and attachments, if any,
are confidential. If you are not the named recipient please notify the
sender and immediately delete it. You may not disseminate, distribute, or
forward this e-mail message or disclose its contents to anybody else.
Copyright and any other intellectual property rights in its contents are
the sole property of Cantor Fitzgerald.
     E-mail transmission cannot be guaranteed to be secure or error-free.
     The sender therefore does not accept liability for any errors or
     omissions in the contents of this message which arise as a result of
     e-mail transmission.  If verification is required please request a
     hard-copy version.
     Although we routinely screen for viruses, addressees should check this
     e-mail and any attachments for viruses. We make no representation or
     warranty as to the absence of viruses in this e-mail or any
     attachments. Please note that to ensure regulatory compliance and for
     the protection of our customers and business, we may monitor and read
     e-mails sent to and from our server(s).

For further important information, please read the  Important Legal
Information and Legal Statement at
http://www.cantor.com/legal_information.html

--
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


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

  Powered by Linux