         self.useLocalization = currency.useLocalization
         self.useSymbol = currency.useSymbol
         self.useCustomSymbol = currency.useCustomSymbol
-        if let decimalsPreference = prefs.valueForKey("decimals_preference") as! String! {
-            print("Preferred number of decimal places is:", decimalsPreference)
-            guard decimalsPreference != "auto" else {
-                return
-            }
-            self.decimals = Int(decimalsPreference)
+        if preferredNumberOfDecimalPlaces() != nil {
+            self.decimals = preferredNumberOfDecimalPlaces()
         }
         if update {
             self.update()

    
    func update() {
        updateRate()
    }
    
    func recordAsSelected() {

    var useLocalization: Bool = true
    var useSymbol: Bool = true
    var useCustomSymbol: Bool = false
    
    init(withCode code: String, update: Bool = true, remember: Bool = true) {
        setTo(code, update: update, remember: remember)
