James McCool commited on
Commit
cf1b155
Β·
1 Parent(s): 95360a4

Enhance salary display logic in app.py by introducing conditional formatting for total salary. If the total salary exceeds the limit, it now displays an error message, improving user clarity in the lineup summary.

Browse files
Files changed (1) hide show
  1. app.py +11 -6
app.py CHANGED
@@ -1028,16 +1028,21 @@ with tab4:
1028
  })
1029
  summary_row = summary_row[['Salary', 'Median', 'Own%']]
1030
 
1031
- col1, col2, col3 = st.columns([1, 1, 3])
1032
  with col1:
1033
  st.markdown(f"**πŸ’° Per Player:** `${round((50000 - total_salary) / (10 - len(filled_lineup)), 0)}`   ")
1034
 
1035
  with col3:
1036
- st.markdown(
1037
- f"**πŸ’° Salary:** `${round(total_salary, 0)}`   "
1038
- f"**πŸ”₯ Median:** `{round(total_median, 2)}`   "
1039
- f"**πŸ“Š Own%:** `{round(total_own, 2)}`"
1040
- )
 
 
 
 
 
1041
 
1042
  # Optionally, add a button to clear the lineup
1043
  if st.button("Clear Lineup", key='clear_lineup'):
 
1028
  })
1029
  summary_row = summary_row[['Salary', 'Median', 'Own%']]
1030
 
1031
+ col1, col2, col3 = st.columns([2, 1, 3])
1032
  with col1:
1033
  st.markdown(f"**πŸ’° Per Player:** `${round((50000 - total_salary) / (10 - len(filled_lineup)), 0)}`   ")
1034
 
1035
  with col3:
1036
+ if total_salary <= 50000:
1037
+ st.markdown(
1038
+ f"**πŸ’° Salary:** `${round(total_salary, 0)}` &nbsp; "
1039
+ f"**πŸ”₯ Median:** `{round(total_median, 2)}` &nbsp; "
1040
+ )
1041
+ else:
1042
+ st.markdown(
1043
+ f"**❌ Salary:** `${round(total_salary, 0)}` &nbsp; "
1044
+ f"**πŸ”₯ Median:** `{round(total_median, 2)}` &nbsp; "
1045
+ )
1046
 
1047
  # Optionally, add a button to clear the lineup
1048
  if st.button("Clear Lineup", key='clear_lineup'):