Manos Chorianopoulos

Fix market discount value at WalletVC

...@@ -620,11 +620,22 @@ public class swiftApi { ...@@ -620,11 +620,22 @@ 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 +
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 + }
628 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? ?? ""
......