note 57376 added to function.number-format

From: Date: Sat, 01 Oct 2005 22:02:24 +0000
Subject: note 57376 added to function.number-format
Groups: php.notes 
Request: Send a blank email to php-notes+get-96150@lists.php.net to get a copy of this message
If you want to display a number ending with ,- (like 200,-) when there are no decimal characters and display the decimals when there are decimal characters i use: function DisplayDouble($value) { list($whole, $decimals) = split ('[.,]', $value, 2); if (intval($decimals) > 0) return number_format($value,2,".",","); else return number_format($value,0,".",",") .",-"; } ---- Manual Page -- http://www.php.net/manual/en/function.number-format.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+57376 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+57376&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+57376&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+57376&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+57376&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+57376&report=yes&reason=non-english Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+57376&report=yes&reason=already+in+docs Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+57376&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+57376&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#96150) next »