                        _ shippingState : String?,
                        _ priceDetails : BSPriceDetails) -> Void {
 
-        var taxPercent : Double = 0
+        var taxPercent: NSNumber = 0
         if shippingCountry.uppercased() == "US" {
             taxPercent = 5
             if let state = shippingState {

        } else if shippingCountry.uppercased() == "CA" {
            taxPercent = 1
        }
        let newTax = priceDetails.amount * taxPercent / 100.0
        NSLog("Changing tax amount from \(priceDetails.taxAmount) to \(newTax)")
        priceDetails.taxAmount = newTax
    }

        
        if let priceDetails = initialData.priceDetails {
            if let newCurrency = newCurrency {
                var oldRate: NSNumber! = 1.0
                if let oldCurrency = oldCurrency {
                    oldRate = oldCurrency.getRateNSNumber()
                }
                // convert the prices back to $
                priceDetails.amount = priceDetails.amount.doubleValue / oldRate.doubleValue as NSNumber
                priceDetails.taxAmount = priceDetails.taxAmount.doubleValue / oldRate.doubleValue as NSNumber
                
                priceDetails.currency = newCurrency.getCode()
                priceDetails.amount = priceDetails.amount.doubleValue * newCurrency.getRateNSNumber().doubleValue as NSNumber
                priceDetails.taxAmount = priceDetails.taxAmount.doubleValue * newCurrency.getRateNSNumber().doubleValue as NSNumber
            }

            valueTextField.text = String(describing: priceDetails.amount)
            taxTextField.text = String(describing: priceDetails.taxAmount)
            currencyButton.titleLabel?.text = priceDetails.currency
        }
    }
