How to insert "%" after result on st.metric?

Summary

I cant show my result on metric with porcentage

Steps to reproduce

Code snippet:

atend_prev = pd.read_excel(r'Planlog Comodato.xlsm', sheet_name='PLANLOG')
            atend_prev = atend_prev.groupby('FAMILIA')['ATENDIMENTO PREVISÃO', ' PREVISÃO ATUAL'].sum()
            perc_atend = (atend_prev['ATENDIMENTO PREVISÃO'] / atend_prev[' PREVISÃO ATUAL'] * 100).astype('int')
            #st.dataframe(venda)
            st.metric(label='ATENDIMENTO DE PREVISÃO EM (%)', value=perc_atend)```

Like this?

st.metric(
    label='ATENDIMENTO DE PREVISÃO EM (%)',
    value=str(perc_atend) + "%"
)

Not good, the tittle of the column is printed, because i divided two columns on dataframe to know my result, the line 3 - perc_atend
image

Not sure what the problem is. Your screenshot seems clipped. Is there not a % symbol after the result? I don’t know what there is in perc_atend so I cannot run the code in my computer to see how it looks like with your data. It works well with my own data.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.