Ottosen commited on
Commit
daf201d
·
1 Parent(s): 475e92a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -1,10 +1,10 @@
1
  import gradio as gr
2
 
3
- def house_saving(annual_salary, portion_saved, total_cost,portion_down_payment):
4
- if total_cost * protion_down_payment - portion_saved < 0:
5
- return 0
6
- else:
7
- months = (total_cost * protion_down_payment - portion_saved) / (annual_salary / 12)
8
  return months
9
 
10
 
 
1
  import gradio as gr
2
 
3
+ def house_saving(annual_salary, portion_saved, total_cost, portion_down_payment):
4
+ if (annual_salary * portion_saved) / 12 > total_cost:
5
+ return 1
6
+ else
7
+ months = roundup((total_cost * protion_down_payment - portion_saved) / ((annual_salary * portion_saved) / 12))
8
  return months
9
 
10