Add rounded extension

pull/2/head
Michael Scoff 7 years ago
parent 6bb95363fe
commit 4a19209450
  1. 10
      Trust/Extensions/Double.swift

@ -0,0 +1,10 @@
// 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
}
}
Loading…
Cancel
Save