How to format selectbox for %

Trying to format values for this select box as “%f%”, e.g. 5%

st.sidebar.slider("select box", min_value=0, max_value=5, format="0:.0%")

but get this error: SyntaxError: [sprintf] unexpected placeholder

I also tried format=“%f%”

how can I format these ints so that they just have a ‘%’ after them?

Figured it out. To get a ‘%’ you need to do ‘%%’

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