Lisibonny commited on
Commit
963ec7c
1 Parent(s): ae4536b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -138,6 +138,7 @@ def main():
138
  else:
139
 
140
  df_results=detalles_resultados(df,result)
 
141
  batch_size = 5
142
  pages = split_frame(df_results, batch_size)
143
  top_menu = st.columns(3)
@@ -147,14 +148,16 @@ def main():
147
 
148
  bottom_menu = st.columns((3))
149
  with bottom_menu[2]:
150
- total_pages = (ceil(len(df_results) / batch_size) if ceil(len(df_results) / batch_size) > 0 else 1)
 
151
  current_page = st.number_input("Página", min_value=1, max_value=total_pages, step=1)
152
 
153
  with bottom_menu[1]:
154
  st.markdown(f"Página **{current_page}** de **{total_pages}** ")
155
 
156
  with top_menu[0]:
157
- st.markdown(f"Artículos **{(current_page*batch_size)-batch_size+1}-{batch_size*current_page}** de **{len(df_results)}** ")
 
158
 
159
  with pagination:
160
 
 
138
  else:
139
 
140
  df_results=detalles_resultados(df,result)
141
+ cantidad_resultados=len(df_results)
142
  batch_size = 5
143
  pages = split_frame(df_results, batch_size)
144
  top_menu = st.columns(3)
 
148
 
149
  bottom_menu = st.columns((3))
150
  with bottom_menu[2]:
151
+ st.write("---")
152
+ total_pages = (ceil(cantidad_resultados / batch_size) if ceil(cantidad_resultados / batch_size) > 0 else 1)
153
  current_page = st.number_input("Página", min_value=1, max_value=total_pages, step=1)
154
 
155
  with bottom_menu[1]:
156
  st.markdown(f"Página **{current_page}** de **{total_pages}** ")
157
 
158
  with top_menu[0]:
159
+ pagina_res_fin= batch_size*current_page if batch_size*current_page <= cantidad_resultados else cantidad_resultados
160
+ st.markdown(f"Artículos **{(current_page*batch_size)-batch_size+1}-{pagina_res_fin}** de **{cantidad_resultados}** ")
161
 
162
  with pagination:
163