I am using a third party package called streamlit and one of the APIs can draw a slider in the browser according to this:
streamlit.slider(label, min_value=None, max_value=None, value=None, step=None, format=None, key=None)
The slider that I've created can take on integer values (i.e., 1,000,000 or 10,000, etc)and this function above has an optional argument that can format this integer using printf
:
format (str or None) – A printf-style format string controlling how the interface should display numbers. This does not impact the return value.
Valid formatters: %d %e %f %g %i
For an integer, 1000000
, I could set the printf style formatting as format="%d"
but I want the output to look like 1,000,000
. I can't seem to figure out if there is a way to accomplish this given the available formatting constraints.