Showing
1 changed file
with
12 additions
and
1 deletions
... | @@ -620,12 +620,23 @@ public class swiftApi { | ... | @@ -620,12 +620,23 @@ public class swiftApi { |
620 | self.name = dictionary["name"] as? String? ?? "" | 620 | self.name = dictionary["name"] as? String? ?? "" |
621 | self.image = dictionary["image"] as? String? ?? "" | 621 | self.image = dictionary["image"] as? String? ?? "" |
622 | self.description = dictionary["description"] as? String? ?? "" | 622 | self.description = dictionary["description"] as? String? ?? "" |
623 | - self.discount = dictionary["discount"] as? String? ?? "" | 623 | +// self.discount = dictionary["discount"] as? String? ?? "" |
624 | self.coupon = dictionary["coupon"] as? String? ?? "" | 624 | self.coupon = dictionary["coupon"] as? String? ?? "" |
625 | self.category = dictionary["category"] as? String? ?? "" | 625 | self.category = dictionary["category"] as? String? ?? "" |
626 | self.barcode = dictionary["barcode"] as? String? ?? "" | 626 | self.barcode = dictionary["barcode"] as? String? ?? "" |
627 | self.status = dictionary["status"] as? Int? ?? nil | 627 | self.status = dictionary["status"] as? Int? ?? nil |
628 | 628 | ||
629 | + if let tempDiscount = dictionary["discount"] as? String? ?? "" { | ||
630 | + if tempDiscount.contains(",") { | ||
631 | + let formattedDiscount = tempDiscount.replacingOccurrences(of: ",", with: ".") | ||
632 | + self.discount = formattedDiscount | ||
633 | + } else { | ||
634 | + self.discount = dictionary["discount"] as? String? ?? "" | ||
635 | + } | ||
636 | + } else { | ||
637 | + self.discount = "" | ||
638 | + } | ||
639 | + | ||
629 | // Market Coupon | 640 | // Market Coupon |
630 | self.inner_text = dictionary["inner_text"] as? String? ?? "" | 641 | self.inner_text = dictionary["inner_text"] as? String? ?? "" |
631 | self.merchant_uuid = dictionary["merchant_uuid"] as? String? ?? "" | 642 | self.merchant_uuid = dictionary["merchant_uuid"] as? String? ?? "" | ... | ... |
-
Please register or login to post a comment