title: Printing floating point numbers in Haskell
body: <p>I have a function in Haskell which looks like this</p>
  
  <pre><code>type Price    = Int
  
  formatPence :: Price -&gt; String
  formatPence a = show (a `div` 100) ++ "." ++ show(a `mod` 100)
  </code></pre>
  
  <p>so that, for example, if I input <code>formatPence 1023</code>, the output would be <code>"10.23"</code>. But I have a problem if I input <code>1202</code> because the output would be <code>"12.2"</code>. What should I add? Thanks :)</p>