I’m trying to write an app that deals with currency, and I would like to present currencies in the user’s own home currency. In Python this seems pretty easy to do in general by just using the builtin locale.currency
function from the standard library, which will take care of all the messy edge-cases for me (like 3-vs-4-digit comma groupings, period-vs-comma decimal separators, etc.).
→ I want to use locale.currency
in my Streamlit app. However, all of the elements and other library functions I’ve seen so far (e.g. st.slider
, st.column_config.NumberColumn
) only take “a printf-style format string” to format values. And I’m not aware of a way to use format strings to handle the corner-cases I described above, or of a library that automatically provides such format strings for localization.