     // MARK: Actions
     
     private func setState() {
-        if value.round1 >= maximumValue {
+        if value.rounded(numberFormatter.maximumFractionDigits) >= maximumValue {
             increaseButton.enabled = false
             increaseLayer.strokeColor = UIColor.grayColor().CGColor
             continuousTimer?.invalidate()
-        } else if value.round1 <= minimumValue {
+        } else if value.rounded(numberFormatter.maximumFractionDigits) <= minimumValue {
             decreaseButton.enabled = false
             decreaseLayer.strokeColor = UIColor.grayColor().CGColor
             continuousTimer?.invalidate()

    
    // Display the value with the
    private func setFormattedValue(value: Double) {
        switch valueType {
        case .Integer:
            valueLabel.text = String(Int(value))
        case .OneDecimal:
            valueLabel.text = String(value.round1)
        case .TwoDecimal:
            valueLabel.text = String(value.round2)
        }
    }
    
    // Update all the subviews tintColor properties.

// MARK: Double - Extension

extension Double {
    func rounded(digits: Int) -> Double {
        let decimalValue = pow(10.0, Double(digits))
        return round(self * decimalValue) / decimalValue
    }
}
