Inconsistent decimal separator in st.number_input

Summary

There are some inconsistencies in displaying floats in st.number_input. Floats with two decimal places are displayed as β€˜X,XX’ whereas floats with one decimal places are displayed as β€˜X.X’. I tried to set the number format to β€œ%0.2f”, but this did not change the issue.

Steps to reproduce

import streamlit as st
 
st.set_page_config(
    page_title="Test",
    page_icon=":clipboard:",
)

st.title('test')
st.sidebar.title('Test.')



with st.sidebar:

    test = st.number_input(
                label = 'min1',
                min_value = 0.00,
                max_value = 1.00,
                value = 0.44
            )

    test2 = st.number_input(
                label = 'min2',
                min_value=0.10,
                max_value=2.10,
                value=0.4
            )
    
    test3 = st.number_input(
                label = 'min3',
                min_value=0.10,
                max_value=2.10,
                value=0.44,
                format = "%0.2f"
            )

Screenshot 2023-11-02 151430

Debug Info:
Python 3.10.13
Streamlit, version 1.28.0
Using Conda Environment

I was unable to replicate your issue.

image


Debug info:
Python 3.11
Streamlit 1.28
Firefox on Windows

Hi, I can confirm some inconsistent behavior.
When I set my browser (Firefox) to a different locale (Like Dutch, Belgium), the number may first show as β€œ4,71” but when I type β€œ4,7” into the box, it changes to β€œ4.70”. Likewise when using the -/+ buttons to change the value, it displays with a β€œ.” instead of a β€œ,”.
So it somehow depends on the number of digits that I enter. I can enter it either as β€œ4.72” or β€œ4,72”, which are both accepted and displayed as I originally entered them.
But β€œ4,7” changes to β€œ4.70”.
Hope this helps clarifying the issue.
It seems silly but if I want to format a whole page using β€œ,” as the decimal separator (which is used in a large part of the world), it would be nice to have it in the number inputs as well.
Thanks!

Also, when I set my browser to English-US, it does NOT accept β€œ4,6” with the β€œ,” as decimal separator. It just ignores my input and uses the previous value.