title: Why is PHP's NumberFormatter nickel-rounding formatted Swiss Franc amounts?
body: <p>Using the <a href="https://php.net/manual/en/numberformatter.formatcurrency.php" rel="nofollow noreferrer"><code>formatCurrency()</code></a> method on the <a href="https://secure.php.net/manual/en/class.numberformatter.php" rel="nofollow noreferrer"><code>NumberFormatter</code></a> class with the CHF (Swiss Francs) currency is rounding amounts to the nearest nickel amount (0.05) for me.</p>
  
  <p>Code:</p>
  
  <pre><code>$formatter = new \NumberFormatter('en_US', \NumberFormatter::CURRENCY);
  echo $formatter-&gt;formatCurrency('12.34', 'CHF');
  </code></pre>
  
  <p>Result:</p>
  
  <blockquote>
    <p>CHF12.35</p>
  </blockquote>
  
  <p>Notice that the numeric amount 12.34 rounds up to 12.35. At first, I thought potentially this was expected and a new way of handling money that I am unfamiliar with. Turns out, that is not how it is supposed to work. (<a href="https://money.stackexchange.com/q/105014/81599">https://money.stackexchange.com/q/105014/81599</a>)</p>
  
  <p>Why is it rounding up / down to the nearest nickel amount in PHP, and how can I fix it?</p>