 
 
 }
+
+extension Double {
+    func split() -> [Int] {
+        return String(self).characters.split{$0 == "."}.map({
+            return Int(String($0))!
+        })
+    }
+}


    // MARK: Swap input with output.

    func swapInputWithOutput(convertInput: Bool) {
        if convertInput {
            let inputValue: Double! = Double(input.integer + "." + input.decimal)
            let old: String! = String(convertToOutputCurrency(inputValue))
            let new: Array! = old.characters.split{$0 == "."}.map(String.init)

            input.integer = new[0]
            input.decimal = new[1]
        }
        let newInputCurrencyCode = outputCurrency.code
        let newOutputCurrencyCode = inputCurrency.code
        inputCurrency.setTo(newInputCurrencyCode)
        outputCurrency.setTo(newOutputCurrencyCode)
    }

    // MARK: Reset.

    // MARK: Remove input.

    func removeLastInput() {
        if input.decimalMode && inputCurrency.decimals > 0 {
            if input.decimal.isEmpty {
                input.decimalMode = false
            } else {
