title: How do you convert int to double in swift?
body: <p>I've looked at the answers for converting int's to floats and other similar answers but they don't do exactly what I want. </p>
  
  <p>I'm trying to create a basic program that takes a number does some different calculations onto it and the results of those calculations are added together at the end.</p>
  
  <p>For one of those calculations I created a segmented controller with the 3 different values below </p>
  
  <pre><code> var myValues: [Double] = [0.00, 1.00, 1.50]
   var myValue = [myValuesSegmentedController.selectedSegmentIndex]
  </code></pre>
  
  <p>then when one of those values is picked, it's added to the final value. All the values added together are Doubles to 2 decimal places.</p>
  
  <pre><code>var totalAmount = valueA + valueB + valueC + myValue
  </code></pre>
  
  <p>the problem I'm having is that swift won't let me add "myValue" to those final calculations. It gives me the error: </p>
  
  <pre><code>Swift Compiler Error. Cannot invoke '+' with an argument list of type '($T7, @lvalue [int])'
  </code></pre>
  
  <p>What do I need to do to change that value to a Double? Or what can I do to get a similar result?</p>