Extension Double Round to places Swift 3
<p>I have the following extension</p>

<pre><code>extension Double {
    func roundToPlaces(places:Int) -&gt; Double {
        let divisor = pow(10.0, Double(places))
        return (self * divisor).rounded / divisor
    }
}
</code></pre>

<p>When I update it to Swift 3, it doesn't work. I tried the solution <a href="https://stackoverflow.com/questions/39512671/swift-3-migration-double-extension-rounding-issue">here</a>, but I got</p>

<p><code>Binary operator '/' cannot be applied to operands of type '_' and 'Double'</code> error </p>