title: Rounding a double value to x number of decimal places in swift
body: <p>Can anyone tell me how to round a double value to x number of decimal places in Swift?</p>
  
  <p>I have: </p>
  
  <pre><code>var totalWorkTimeInHours = (totalWorkTime/60/60)
  </code></pre>
  
  <p>With <code>totalWorkTime</code> being an NSTimeInterval (double) in second.</p>
  
  <p><code>totalWorkTimeInHours</code> will give me the hours, but it gives me the amount of time in such a long precise number e.g. 1.543240952039......</p>
  
  <p>How do I round this down to, say, 1.543 when I print <code>totalWorkTimeInHours</code>?</p>