Skkinycalvs commited on
Commit
8069421
1 Parent(s): a6f8c81

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -9
app.py CHANGED
@@ -1,3 +1,4 @@
 
1
  import numpy as np
2
  import matplotlib.pyplot as plt
3
 
@@ -18,16 +19,15 @@ def graficar_cashflow(cashflow):
18
  plt.xlabel('Mes')
19
  plt.ylabel('Saldo')
20
  plt.grid(True)
21
- plt.show()
22
 
23
  def main():
24
- n = int(input("Ingrese el número de mensualidades: "))
25
- A = float(input("Ingrese el monto de la mensualidad: "))
26
- r = float(input("Ingrese la tasa de interés (%): "))
27
- Pi = float(input("Ingrese el depósito inicial: "))
 
28
 
29
- cashflow = calcular_cashflow(n, A, r, Pi)
30
- graficar_cashflow(cashflow)
31
 
32
- if __name__ == "__main__":
33
- main()
 
1
+ import streamlit as st
2
  import numpy as np
3
  import matplotlib.pyplot as plt
4
 
 
19
  plt.xlabel('Mes')
20
  plt.ylabel('Saldo')
21
  plt.grid(True)
22
+ st.pyplot()
23
 
24
  def main():
25
+ st.title('Calculadora de Cashflow')
26
+ n = st.number_input("Ingrese el número de mensualidades:", min_value=1, step=1, format='%d')
27
+ A = st.number_input("Ingrese el monto de la mensualidad:", min_value=0.0, step=1.0, format='%f')
28
+ r = st.number_input("Ingrese la tasa de interés (%):", min_value=0.0, step=0.01, format='%f')
29
+ Pi = st.number_input("Ingrese el depósito inicial:", min_value=0.0, step=1.0, format='%f')
30
 
31
+ if st.button('Calcular y Graficar Cashflow'):
32
+
33