note 116725 added to function.money-format

From: Date: Thu, 19 Feb 2015 22:22:01 +0000
Subject: note 116725 added to function.money-format
Groups: php.notes 
Request: Send a blank email to php-notes+get-201760@lists.php.net to get a copy of this message
For most of us in the US, we don't want to see a "USD" for our currency symbol, so '%i' doesn't cut it. Here's what I used that worked to get what most people expect to see for a number format. $number = 123.4 setlocale(LC_MONETARY, 'en_US.UTF-8'); money_format('%.2n', $number); output: $123.40 That gives me a dollar sign at the beginning, and 2 digits at the end. ---- Server IP: 72.52.91.14 Probable Submitter: 174.30.109.225 ---- Manual Page -- http://php.net/manual/en/function.money-format.php Edit -- https://master.php.net/note/edit/116725 Del: integrated -- https://master.php.net/note/delete/116725/integrated Del: useless -- https://master.php.net/note/delete/116725/useless Del: bad code -- https://master.php.net/note/delete/116725/bad+code Del: spam -- https://master.php.net/note/delete/116725/spam Del: non-english -- https://master.php.net/note/delete/116725/non-english Del: in docs -- https://master.php.net/note/delete/116725/in+docs Del: other reasons-- https://master.php.net/note/delete/116725 Reject -- https://master.php.net/note/reject/116725 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#201760) next »