Formatting user input display in widgets

Hello,

I am writing a calculator that does some math based on user input. One field I would like to use is a currency field which accepts someone’s annual income.

I tried using st.number_inputbut found that the format field is terribly limited by the underlying sprintf.js implementation and thus has no mechanism for inserting thousands separators or even a currency prefix. I’m not sure why— st.column_config.NumberColumn appears to be able to handle at least the prefixing of a number of characters.

There was an old currency input component I found, but it did not seem to do anything when I used it.

I tried to play with default values and session state of the st.text_input widget but it seems impossible to adjust the value of a widget after it has gathered an input in the code because streamlit executes top to bottom.

Is there any way to format user input while they type? Numbers with lots of zeroes become hard to read while typing them.