note 40704 added to function.number-format
| From: | S dot Rahmel at rn2 dot php dot net | Date: | Thu, 11 Mar 2004 19:47:07 +0000 |
| Subject: | note 40704 added to function.number-format | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-66679@lists.php.net to get a copy of this message | ||
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.
----
Manual Page -- http://www.php.net/manual/en/function.number-format.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+40704
Delete -- http://master.php.net/manage/user-notes.php?action=delete+40704&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+40704&report=yes
Search -- http://master.php.net/manage/user-notes.php