note 25379 deleted from function.floatval by sniper
| From: | sniper@php.net | Date: | Sat, 23 Aug 2003 00:16:40 +0000 |
| Subject: | note 25379 deleted from function.floatval by sniper | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-54904@lists.php.net to get a copy of this message | ||
Note Submitter: mads@gartneriet.dk
----
floatval() is using the current locale to determine its values. On an english locale
floatval("4.51 pieces"); will return 4.51.
But if I use
setlocale("LC_ALL", "danish");
first, then floatval("4.51 pieces"); will return 4 because the decimal point in danish is
a comma (,) not a dot (.)