note 92563 added to function.floatval
| From: | chris at georgakopoulos dot com | Date: | Wed, 29 Jul 2009 15:12:34 +0000 |
| Subject: | note 92563 added to function.floatval | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-158881@lists.php.net to get a copy of this message | ||
locale aware floatval:
function ParseFloat($floatString){
$LocaleInfo = localeconv();
$floatString = str_replace($LocaleInfo["mon_thousands_sep"] , "",
$floatString);
$floatString = str_replace($LocaleInfo["mon_decimal_point"] , ".",
$floatString);
return floatval($floatString);
}
----
Server IP: 209.41.74.194
Probable Submitter: 79.129.21.28
----
Manual Page -- http://www.php.net/manual/en/function.floatval.php
Edit -- https://master.php.net/note/edit/92563
Del: integrated -- https://master.php.net/note/delete/92563/integrated
Del: useless -- https://master.php.net/note/delete/92563/useless
Del: bad code -- https://master.php.net/note/delete/92563/bad+code
Del: spam -- https://master.php.net/note/delete/92563/spam
Del: non-english -- https://master.php.net/note/delete/92563/non-english
Del: in docs -- https://master.php.net/note/delete/92563/in+docs
Del: other reasons-- https://master.php.net/note/delete/92563
Reject -- https://master.php.net/note/reject/92563
Search -- https://master.php.net/manage/user-notes.php