Nathanotal commited on
Commit
a13ff21
·
1 Parent(s): a449aa6
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -216,7 +216,8 @@ def addDotsToPrice(price):
216
  toReturn += c
217
  if (len(price) - i) % 3 == 1 and i != len(price) - 1:
218
  toReturn += '.'
219
-
 
220
  return toReturn
221
 
222
 
@@ -280,7 +281,7 @@ def isValidInput(streetName, number, sqm, rooms, monthlyFee, monthlyCost, floor,
280
 
281
  def getDates():
282
  today = date.today()
283
- inAMonth = today + timedelta(days=30)
284
  inAYear = today + timedelta(days=365)
285
  lastYear = today - timedelta(days=365)
286
  beforeUkraineWar = '2022-02-24'
@@ -288,7 +289,7 @@ def getDates():
288
 
289
  dateToExplanation = {
290
  today.strftime("%Y-%m-%d") : 'today',
291
- inAMonth.strftime("%Y-%m-%d") : 'in a month',
292
  inAYear.strftime("%Y-%m-%d") : 'in a year',
293
  lastYear.strftime("%Y-%m-%d") : 'last year',
294
  threeYearsAgo.strftime("%Y-%m-%d") : 'three years ago',
@@ -344,7 +345,7 @@ def sthlm(streetName, number, sqm, rooms, monthlyFee, monthlyCost, floor, yearBu
344
  if diff > 0:
345
  result.append(f'If the apartment would be sold {explanation} it would have been worth more: {parsePrice(pred)} (+{parsePrice(diff)})')
346
  else:
347
- result.append(f'If the apartment would be sold {explanation} it would have been worth less: {parsePrice(pred)} ({parsePrice(diff)})')
348
 
349
  return '\n'.join(result), ''
350
 
 
216
  toReturn += c
217
  if (len(price) - i) % 3 == 1 and i != len(price) - 1:
218
  toReturn += '.'
219
+ if toReturn[0] == '.':
220
+ toReturn = toReturn[1:]
221
  return toReturn
222
 
223
 
 
281
 
282
  def getDates():
283
  today = date.today()
284
+ # inAMonth = today + timedelta(days=30)
285
  inAYear = today + timedelta(days=365)
286
  lastYear = today - timedelta(days=365)
287
  beforeUkraineWar = '2022-02-24'
 
289
 
290
  dateToExplanation = {
291
  today.strftime("%Y-%m-%d") : 'today',
292
+ # inAMonth.strftime("%Y-%m-%d") : 'in a month',
293
  inAYear.strftime("%Y-%m-%d") : 'in a year',
294
  lastYear.strftime("%Y-%m-%d") : 'last year',
295
  threeYearsAgo.strftime("%Y-%m-%d") : 'three years ago',
 
345
  if diff > 0:
346
  result.append(f'If the apartment would be sold {explanation} it would have been worth more: {parsePrice(pred)} (+{parsePrice(diff)})')
347
  else:
348
+ result.append(f'If the apartment would be sold {explanation} it would have been worth less: {parsePrice(pred)} (-{parsePrice(diff)})')
349
 
350
  return '\n'.join(result), ''
351