title: Swift number formatting
body: <p>I am just starting to get to know Swift but I am having a serious problem with number formatting at an extremely basic level.</p>
  
  <p>For example, I need to display an integer with at least 2 digits (e.g. 00, 01, 02, 03, 04, 05 ...). The normal syntax I'd expect would be something like:</p>
  
  <p>println(" %02i %02i %02i", var1, var2, var3);</p>
  
  <p>...but I don't find any clear instruction for how to achieve this in Swift. I find it really hard to believe that I need to create a custom function to do that. The same for returning a float or double value to a fixed number of decimal places.</p>
  
  <p>I've found links to a couple of similar questions (<a href="https://stackoverflow.com/questions/24051314/precision-string-format-specifier-in-swift">Precision String Format Specifier In Swift</a> &amp; <a href="https://stackoverflow.com/questions/24102814/how-to-use-println-in-swift-to-format-number">How to use println in Swift to format number</a>) but they seem to mix objective C and even talk about Python and using unity libraries. Is there no Swift solution to this basic programming need? Is it really true that something so fundamental has been completely overlooked in Swift? </p>