note 25041 added to function.setlocale

From: Date: Mon, 09 Sep 2002 00:02:19 +0000
Subject: note 25041 added to function.setlocale
Groups: php.notes 
Request: Send a blank email to php-notes+get-36368@lists.php.net to get a copy of this message
be careful with the LC_ALL setting, as it may introduce some unwanted conversions. For example, I used setlocale (LC_ALL, "Dutch"); to get my weekdays in dutch on the page. From that moment on (as I found out many hours later) my floating point values from MYSQL where interpreted as integers because the Dutch locale wants a comma (,) instead of a point (.) before the decimals. I tried printf, number_format, floatval.... all to no avail. 1.50 was always printed as 1.00 :( When I set my locale to : setlocale (LC_TIME, "Dutch"); my weekdays are good now and my floating point values too. I hope I can save some people the trouble of figuring this out by themselves. Rob -- http://www.php.net/manual/en/function.setlocale.php http://master.php.net/manage/user-notes.php?action=edit+25041 http://master.php.net/manage/user-notes.php?action=delete+25041 http://master.php.net/manage/user-notes.php?action=reject+25041

« previous php.notes (#36368) next »