|
@@ -975,40 +975,34 @@ class KMMemberCenterManager: NSObject {
|
|
|
if let token = dict1["cycle"] { cycle = token as? Int ?? cycle }
|
|
|
if let token = dict1["code"] { code = token as? String ?? code }
|
|
|
|
|
|
- if let token = dict1["price"] {
|
|
|
- if let tPrice = token as? NSNumber {
|
|
|
- priceString = "\(tPrice)"
|
|
|
- price = tPrice
|
|
|
- }
|
|
|
-
|
|
|
+ if let token = dict1["price"] as? NSNumber {
|
|
|
+ let string = KMFormatNSNumber(token, to: 2)
|
|
|
+ priceString = string
|
|
|
+ price = token
|
|
|
}
|
|
|
|
|
|
- if let token = dict1["displayPrice"] {
|
|
|
- if let tPrice = token as? NSNumber {
|
|
|
- displayPriceString = "\(tPrice)"
|
|
|
- displayPrice = tPrice
|
|
|
- }
|
|
|
+ if let token = dict1["displayPrice"] as? NSNumber {
|
|
|
+ let string = KMFormatNSNumber(token, to: 2)
|
|
|
+ displayPriceString = string
|
|
|
+ displayPrice = token
|
|
|
}
|
|
|
|
|
|
- if let token = dict1["upgradePrice"] {
|
|
|
- if let tPrice = token as? NSNumber {
|
|
|
- upgradePriceString = "\(tPrice)"
|
|
|
- upgradePrice = tPrice
|
|
|
- }
|
|
|
+ if let token = dict1["upgradePrice"] as? NSNumber {
|
|
|
+ let string = KMFormatNSNumber(token, to: 2)
|
|
|
+ upgradePriceString = string
|
|
|
+ upgradePrice = token
|
|
|
}
|
|
|
|
|
|
- if let token = dict1["cnyPrice"] {
|
|
|
- if let tPrice = token as? NSNumber {
|
|
|
- cnyPriceString = "\(tPrice)"
|
|
|
- cnyPrice = tPrice
|
|
|
- }
|
|
|
+ if let token = dict1["cnyPrice"] as? NSNumber {
|
|
|
+ let string = KMFormatNSNumber(token, to: 2)
|
|
|
+ cnyPriceString = string
|
|
|
+ cnyPrice = token
|
|
|
}
|
|
|
|
|
|
- if let token = dict1["displayCnyPrice"] {
|
|
|
- if let tPrice = token as? NSNumber {
|
|
|
- displayCnyPriceString = "\(tPrice)"
|
|
|
- displayCnyPrice = tPrice
|
|
|
- }
|
|
|
+ if let token = dict1["displayCnyPrice"] as? NSNumber {
|
|
|
+ let string = KMFormatNSNumber(token, to: 2)
|
|
|
+ displayCnyPriceString = string
|
|
|
+ displayCnyPrice = token
|
|
|
}
|
|
|
|
|
|
let products = KMListingProductsModel(id: id, productName: productName, price: priceString, maxDeviceNum: maxDeviceNum, displayPrice: displayPriceString, levels: levels, platforms: platforms, productLineId: productLineId, paymentModel: paymentModel, cycle: cycle, cnyPrice: cnyPriceString, displayCnyPrice: displayCnyPriceString, upgradePrice: upgradePriceString, code: code)
|
|
@@ -1096,35 +1090,30 @@ class KMMemberCenterManager: NSObject {
|
|
|
if let token = dict1["cycle"] { cycle = token as? Int ?? cycle }
|
|
|
if let token = dict1["code"] { code = token as? String ?? code }
|
|
|
|
|
|
- if let token = dict1["price"] {
|
|
|
- if let tPrice = token as? NSNumber {
|
|
|
- priceString = "\(tPrice)"
|
|
|
- price = tPrice
|
|
|
- }
|
|
|
+ if let token = dict1["price"] as? NSNumber {
|
|
|
+ let string = KMFormatNSNumber(token, to: 2)
|
|
|
+ priceString = string
|
|
|
+ price = token
|
|
|
}
|
|
|
- if let token = dict1["displayPrice"] {
|
|
|
- if let tPrice = token as? NSNumber {
|
|
|
- displayPriceString = "\(tPrice)"
|
|
|
- displayPrice = tPrice
|
|
|
- }
|
|
|
+ if let token = dict1["displayPrice"] as? NSNumber {
|
|
|
+ let string = KMFormatNSNumber(token, to: 2)
|
|
|
+ displayPriceString = string
|
|
|
+ displayPrice = token
|
|
|
}
|
|
|
- if let token = dict1["upgradePrice"] {
|
|
|
- if let tPrice = token as? NSNumber {
|
|
|
- upgradePriceString = "\(tPrice)"
|
|
|
- upgradePrice = tPrice
|
|
|
- }
|
|
|
+ if let token = dict1["upgradePrice"] as? NSNumber {
|
|
|
+ let string = KMFormatNSNumber(token, to: 2)
|
|
|
+ upgradePriceString = string
|
|
|
+ upgradePrice = token
|
|
|
}
|
|
|
- if let token = dict1["cnyPrice"] {
|
|
|
- if let tPrice = token as? NSNumber {
|
|
|
- cnyPriceString = "\(tPrice)"
|
|
|
- cnyPrice = tPrice
|
|
|
- }
|
|
|
+ if let token = dict1["cnyPrice"] as? NSNumber {
|
|
|
+ let string = KMFormatNSNumber(token, to: 2)
|
|
|
+ cnyPriceString = string
|
|
|
+ cnyPrice = token
|
|
|
}
|
|
|
- if let token = dict1["displayCnyPrice"] {
|
|
|
- if let tPrice = token as? NSNumber {
|
|
|
- displayCnyPriceString = "\(tPrice)"
|
|
|
- displayCnyPrice = tPrice
|
|
|
- }
|
|
|
+ if let token = dict1["displayCnyPrice"] as? NSNumber {
|
|
|
+ let string = KMFormatNSNumber(token, to: 2)
|
|
|
+ displayCnyPriceString = string
|
|
|
+ displayCnyPrice = token
|
|
|
}
|
|
|
|
|
|
let products = KMListingProductsModel(id: id, productName: productName, price: priceString, maxDeviceNum: maxDeviceNum, displayPrice: displayPriceString, levels: levels, platforms: platforms, productLineId: productLineId, paymentModel: paymentModel, cycle: cycle, cnyPrice: cnyPriceString, displayCnyPrice: displayCnyPriceString, upgradePrice: upgradePriceString, code: code)
|
|
@@ -1278,35 +1267,30 @@ class KMMemberCenterManager: NSObject {
|
|
|
if let token = result["cycle"] { cycle = token as? Int ?? cycle }
|
|
|
if let token = result["code"] { code = token as? String ?? code }
|
|
|
|
|
|
- if let token = result["price"] {
|
|
|
- if let tPrice = token as? NSNumber {
|
|
|
- priceString = "\(tPrice)"
|
|
|
- price = tPrice
|
|
|
- }
|
|
|
+ if let token = result["price"] as? NSNumber {
|
|
|
+ let string = KMFormatNSNumber(token, to: 2)
|
|
|
+ priceString = string
|
|
|
+ price = token
|
|
|
}
|
|
|
- if let token = result["displayPrice"] {
|
|
|
- if let tPrice = token as? NSNumber {
|
|
|
- displayPriceString = "\(tPrice)"
|
|
|
- displayPrice = tPrice
|
|
|
- }
|
|
|
+ if let token = result["displayPrice"] as? NSNumber {
|
|
|
+ let string = KMFormatNSNumber(token, to: 2)
|
|
|
+ displayPriceString = string
|
|
|
+ displayPrice = token
|
|
|
}
|
|
|
- if let token = result["upgradePrice"] {
|
|
|
- if let tPrice = token as? NSNumber {
|
|
|
- upgradePriceString = "\(tPrice)"
|
|
|
- upgradePrice = tPrice
|
|
|
- }
|
|
|
+ if let token = result["upgradePrice"] as? NSNumber {
|
|
|
+ let string = KMFormatNSNumber(token, to: 2)
|
|
|
+ upgradePriceString = string
|
|
|
+ upgradePrice = token
|
|
|
}
|
|
|
- if let token = result["cnyPrice"] {
|
|
|
- if let tPrice = token as? NSNumber {
|
|
|
- cnyPriceString = "\(tPrice)"
|
|
|
- cnyPrice = tPrice
|
|
|
- }
|
|
|
+ if let token = result["cnyPrice"] as? NSNumber {
|
|
|
+ let string = KMFormatNSNumber(token, to: 2)
|
|
|
+ cnyPriceString = string
|
|
|
+ cnyPrice = token
|
|
|
}
|
|
|
- if let token = result["displayCnyPrice"] {
|
|
|
- if let tPrice = token as? NSNumber {
|
|
|
- displayCnyPriceString = "\(tPrice)"
|
|
|
- displayCnyPrice = tPrice
|
|
|
- }
|
|
|
+ if let token = result["displayCnyPrice"] as? NSNumber {
|
|
|
+ let string = KMFormatNSNumber(token, to: 2)
|
|
|
+ displayCnyPriceString = string
|
|
|
+ displayCnyPrice = token
|
|
|
}
|
|
|
|
|
|
let products = KMCheckCouponModel(id: id, productName: productName, price: priceString, maxDeviceNum: maxDeviceNum, displayPrice: displayPriceString, levels: levels, platforms: platforms, productLineId: productLineId, paymentModel: paymentModel, cycle: cycle, cnyPrice: cnyPriceString, displayCnyPrice: displayCnyPriceString, upgradePrice: upgradePriceString, code: code)
|