Spaces:
Running
Running
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
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([
|
1032 |
with col1:
|
1033 |
st.markdown(f"**π° Per Player:** `${round((50000 - total_salary) / (10 - len(filled_lineup)), 0)}` ")
|
1034 |
|
1035 |
with col3:
|
1036 |
-
|
1037 |
-
|
1038 |
-
|
1039 |
-
|
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)}` "
|
1039 |
+
f"**π₯ Median:** `{round(total_median, 2)}` "
|
1040 |
+
)
|
1041 |
+
else:
|
1042 |
+
st.markdown(
|
1043 |
+
f"**β Salary:** `${round(total_salary, 0)}` "
|
1044 |
+
f"**π₯ Median:** `{round(total_median, 2)}` "
|
1045 |
+
)
|
1046 |
|
1047 |
# Optionally, add a button to clear the lineup
|
1048 |
if st.button("Clear Lineup", key='clear_lineup'):
|