// Copyright SIX DAY LLC. All rights reserved. import Foundation extension Double { func rounded(to places: Int) -> Double { let divisor = pow(10.0, Double(places)) return (self * divisor).rounded() / divisor } }