     
     fileprivate func loadViewFromNib() -> UIView {
         let bundle = Bundle(for: type(of: self))
-        let nib = UINib(nibName: String(describing: type(of: self)), bundle: bundle)
+        let nibName = String(describing: type(of: self))
+        let nib = UINib(nibName: nibName, bundle: bundle)
         let retview = nib.instantiate(withOwner: self, options: nil).first as! UIView
         return retview
     }
     
     // MARK: Private Helper Methods
     
-    fileprivate func convertFloatToString(_ val:CGFloat) -> String{
+    fileprivate func convertFloatToString(_ val:CGFloat) -> String {
         
         var retString = NSString()
         
-        switch(self.knobFormatType){
+        switch self.knobFormatType {
         case .decimal:
             retString = NSString(format: "%.1f", val)
             
-            // get rid of the decimal for max, min, and when its less than 2 decimal places difference
-            if(val <= self.minimumValue || val >= self.maximumValue || round(100*val)/100 == floor(val)){
+            // get rid of the decimal for max, min, and when it starts with '0.0'
+            if val <= self.minimumValue || val >= self.maximumValue || retString.hasPrefix("0.0") {
                 retString = NSString(format: "%.0f", val)
             }
             

            UIView.animate(withDuration: 0.25
                , delay: 0
                , options: [.curveEaseOut, .beginFromCurrentState]
                , animations:{
                    self.knobPointer?.transform = CGAffineTransform(rotationAngle: pointerAngle)
                }, completion: nil)
            

        get{
            return self.view.backgroundColor
        }
        set {
            if let newColor = newValue {
                self.view.backgroundColor = newColor
            }
        }
    }
    
    @IBInspectable var knobCornerRadius: CGFloat {
        get {
            return self.view.layer.cornerRadius
        }
        set {
            self.view.layer.cornerRadius = newValue
            self.view.layer.masksToBounds = newValue > 0
        }
    }
    
    @IBInspectable var knobBorderWidth: CGFloat {
        get {
            return self.view.layer.borderWidth
        }
        set {
            self.view.layer.borderWidth = newValue
        }
    }
    
    @IBInspectable var knobBorderColor: UIColor? {
        get {
            var retColor:UIColor?
            if let cgColor = self.view.layer.borderColor {
                retColor = UIColor(cgColor: cgColor)
            }
            return retColor
        }
        set {
            self.view.layer.borderColor = newValue?.cgColor
        }
    }
}
