note 44835 added to function.number-format

From: Date: Tue, 17 Aug 2004 18:17:10 +0000
Subject: note 44835 added to function.number-format
Groups: php.notes 
Request: Send a blank email to php-notes+get-79793@lists.php.net to get a copy of this message
A more reliable and concise way of doing what S. Rahmel was trying to do below is as follows: <?php $field_inhalt = str_replace(array(".", ","), array("", "."), $field_inhalt); ?> The str_replace() call will first replace all dots with blanks, and then replace all commas with dots. That way, it doesn't break down when you try a number over one million (i.e. 1.010.453,21). Drew ---- Manual Page -- http://www.php.net/manual/en/function.number-format.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+44835 Delete -- http://master.php.net/manage/user-notes.php?action=delete+44835&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+44835&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#79793) next »