note 40704 deleted from function.number-format by cmb
| From: | cmb@php.net | Date: | Sun, 13 Jan 2019 10:42:58 +0000 |
| Subject: | note 40704 deleted from function.number-format by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-210049@lists.php.net to get a copy of this message | ||
Note Submitter: S. Rahmel
----
if you converted a number to a German format with number_format() and want to save it in mySQL, you
first have to change the number format back to an English format.
For example
10.453,21 >>>> 10453.21
Here is an example how to do this:
$field_array=explode(".", $field_inhalt);
$field_inhalt=$field_array[0].$field_array[1];
$foeld_array=explode(",", $field_inhalt);
$field_inhalt=$field_array[0].".".$feld_array[1];
$field_inhalt=sprintf($field_inhalt, 2);
$field_inhalt is the variable of the actual number you want to change to the english format.