title: Displaying .0 after round numbers in Swift
body: <p>I’ve made a calculator using Doubles in Swift. The problem is that when I display the outcome it will display .0 at the end even if it’s a round number. I have tried the round() function but since it’s a double it still seems to always display .0 . In Objective-c i did this by typing:</p>
  
  <pre><code>[NSString stringWithFormat:@”%.0f”, RunningTotal]; //RunningTotal being the outcome
  </code></pre>
  
  <p>In this case there would be no decimals at all which there would if there stood @”%.3f” for example.</p>
  
  <p>Does anyone know how to do this in swift? I’ve looked around on different forums but couldn’t find it anywhere... Thanks!</p>