Inconsistent decimal separator in st.number_input


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


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',
    test3 = st.number_input(
                label = 'min3',
                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.


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.

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.