title: Use php money format and remove the numbers after the decimal place for GBP
body: <p>I want to format some numbers from my analytics into currency using the GB money format but as its for a dashboard and doesn't need to be that precise so I want to remove the pence (numbers after the decimal place) and round it which helps with the css layout, how do I do this? Rounding up or down to the nearest pound would be fine.</p>
  
  <p>My code is as follows:    </p>
  
  <pre><code>//set locale for currency
  setlocale(LC_MONETARY, 'en_GB');
  
  $sales = '8932.83';
  
  echo utf8_encode(money_format('%n', $sales));
  </code></pre>
  
  <p>This outputs: £8,932.83</p>
  
  <p>However how do I round this to be output as just £8,932 without anything after the decimal place.</p>
  
  <p>I want to use currency format as sometimes the figure is negative in which case money_format returns the number like -£8,932.83 which is preferable to £-8,932 (pound and negative symbol around the wrong way) which is what happened when I formatted using number_format like so:</p>
  
  <pre><code>echo '&amp;pound;'.number_format($sales, 0, '', ',');
  </code></pre>