title: How can I format currency depending on decimal value?
body: <p>I am using <code>NSDecimalNumber</code> to format currency and want the following inputs and outputs:</p>
  
  <p><code>9.99 --&gt; 9.99</code>
  <code>10 --&gt; 10</code>
  <code>10.00 --&gt; 10</code>
  <code>9.90 --&gt; 9.90</code>
  <code>9.9 --&gt; 9.90</code>
  <code>0 --&gt; 0</code>
  <code>0.01 --&gt; 0.01</code>
  <code>20 --&gt; 20</code>
  <code>10.01 --&gt; 10.01</code></p>
  
  <p>How can I do this in Swift.</p>
  
  <p>EDIT: Essentially if there are cents (i.e. cents > 0) then display the cents. Otherwise, don't.</p>