SamiKoen commited on
Commit
62e3b35
·
verified ·
1 Parent(s): c4f784f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +21 -6
app.py CHANGED
@@ -60,8 +60,11 @@ for item in root.findall('item'):
60
  # Normal fiyatı yuvarla
61
  try:
62
  price_float = float(price_str)
63
- # Fiyat basamak sayısına göre yuvarlama
64
- if 1000 <= price_float < 10000: # 4 basamaklı - onlar basamağına yuvarla
 
 
 
65
  price = str(round(price_float / 10) * 10)
66
  elif 10000 <= price_float < 100000: # 5 basamaklı - yüzler basamağına yuvarla
67
  price = str(round(price_float / 100) * 100)
@@ -76,7 +79,10 @@ for item in root.findall('item'):
76
  if price_eft_str:
77
  try:
78
  price_eft_float = float(price_eft_str)
79
- if 1000 <= price_eft_float < 10000: # 4 basamaklı
 
 
 
80
  price_eft = str(round(price_eft_float / 10) * 10)
81
  elif 10000 <= price_eft_float < 100000: # 5 basamaklı
82
  price_eft = str(round(price_eft_float / 100) * 100)
@@ -90,7 +96,10 @@ for item in root.findall('item'):
90
  # Havale indirimli fiyat verilmemişse, orijinal fiyattan %2.5 indirim hesapla
91
  try:
92
  price_eft_float = price_float * 0.975 # %2.5 indirim
93
- if 1000 <= price_eft_float < 10000: # 4 basamaklı
 
 
 
94
  price_eft = str(round(price_eft_float / 10) * 10)
95
  elif 10000 <= price_eft_float < 100000: # 5 basamaklı
96
  price_eft = str(round(price_eft_float / 100) * 100)
@@ -105,7 +114,10 @@ for item in root.findall('item'):
105
  try:
106
  if price_rebate_str:
107
  price_rebate_float = float(price_rebate_str)
108
- if 1000 <= price_rebate_float < 10000: # 4 basamaklı
 
 
 
109
  price_rebate = str(round(price_rebate_float / 10) * 10)
110
  elif 10000 <= price_rebate_float < 100000: # 5 basamaklı
111
  price_rebate = str(round(price_rebate_float / 100) * 100)
@@ -122,7 +134,10 @@ for item in root.findall('item'):
122
  try:
123
  if price_rebate_money_order_str:
124
  price_rebate_money_order_float = float(price_rebate_money_order_str)
125
- if 1000 <= price_rebate_money_order_float < 10000: # 4 basamaklı
 
 
 
126
  price_rebate_money_order = str(round(price_rebate_money_order_float / 10) * 10)
127
  elif 10000 <= price_rebate_money_order_float < 100000: # 5 basamaklı
128
  price_rebate_money_order = str(round(price_rebate_money_order_float / 100) * 100)
 
60
  # Normal fiyatı yuvarla
61
  try:
62
  price_float = float(price_str)
63
+ # Fiyat 30000 üzerindeyse bir üstteki binler basamağına yuvarla
64
+ if price_float > 30000:
65
+ price = str(int((price_float / 1000) + 0.999) * 1000) # Bir üst binlere yuvarla
66
+ # Diğer durumlarda mevcut basamak sayısına göre yuvarlama
67
+ elif 1000 <= price_float < 10000: # 4 basamaklı - onlar basamağına yuvarla
68
  price = str(round(price_float / 10) * 10)
69
  elif 10000 <= price_float < 100000: # 5 basamaklı - yüzler basamağına yuvarla
70
  price = str(round(price_float / 100) * 100)
 
79
  if price_eft_str:
80
  try:
81
  price_eft_float = float(price_eft_str)
82
+ # Fiyat 30000 üzerindeyse bir üstteki binler basamağına yuvarla
83
+ if price_eft_float > 30000:
84
+ price_eft = str(int((price_eft_float / 1000) + 0.999) * 1000) # Bir üst binlere yuvarla
85
+ elif 1000 <= price_eft_float < 10000: # 4 basamaklı
86
  price_eft = str(round(price_eft_float / 10) * 10)
87
  elif 10000 <= price_eft_float < 100000: # 5 basamaklı
88
  price_eft = str(round(price_eft_float / 100) * 100)
 
96
  # Havale indirimli fiyat verilmemişse, orijinal fiyattan %2.5 indirim hesapla
97
  try:
98
  price_eft_float = price_float * 0.975 # %2.5 indirim
99
+ # Fiyat 30000 üzerindeyse bir üstteki binler basamağına yuvarla
100
+ if price_eft_float > 30000:
101
+ price_eft = str(int((price_eft_float / 1000) + 0.999) * 1000) # Bir üst binlere yuvarla
102
+ elif 1000 <= price_eft_float < 10000: # 4 basamaklı
103
  price_eft = str(round(price_eft_float / 10) * 10)
104
  elif 10000 <= price_eft_float < 100000: # 5 basamaklı
105
  price_eft = str(round(price_eft_float / 100) * 100)
 
114
  try:
115
  if price_rebate_str:
116
  price_rebate_float = float(price_rebate_str)
117
+ # Fiyat 30000 üzerindeyse bir üstteki binler basamağına yuvarla
118
+ if price_rebate_float > 30000:
119
+ price_rebate = str(int((price_rebate_float / 1000) + 0.999) * 1000) # Bir üst binlere yuvarla
120
+ elif 1000 <= price_rebate_float < 10000: # 4 basamaklı
121
  price_rebate = str(round(price_rebate_float / 10) * 10)
122
  elif 10000 <= price_rebate_float < 100000: # 5 basamaklı
123
  price_rebate = str(round(price_rebate_float / 100) * 100)
 
134
  try:
135
  if price_rebate_money_order_str:
136
  price_rebate_money_order_float = float(price_rebate_money_order_str)
137
+ # Fiyat 30000 üzerindeyse bir üstteki binler basamağına yuvarla
138
+ if price_rebate_money_order_float > 30000:
139
+ price_rebate_money_order = str(int((price_rebate_money_order_float / 1000) + 0.999) * 1000) # Bir üst binlere yuvarla
140
+ elif 1000 <= price_rebate_money_order_float < 10000: # 4 basamaklı
141
  price_rebate_money_order = str(round(price_rebate_money_order_float / 10) * 10)
142
  elif 10000 <= price_rebate_money_order_float < 100000: # 5 basamaklı
143
  price_rebate_money_order = str(round(price_rebate_money_order_float / 100) * 100)