Thanks to visit codestin.com
Credit goes to github.com

Skip to content

st.column_config 'localized' option doesn't seem to work for some locales #11291

@guinacio

Description

@guinacio

Checklist

  • I have searched the existing issues for similar issues.
  • I added a very descriptive title to this issue.
  • I have provided sufficient information below to help reproduce this issue.

Summary

Localized option doesn't seem to work for locales that have decimal (,) and thousands (.) the other way around, like pt_BR.

Image #

Reproducible Code Example

import streamlit as st
import pandas as pd

st.set_page_config(page_title="Test Dashboard")

st.title("Test Dashboard")

# Create a data frame with some sample data
data = {
    "Name": ["John", "Jane", "Jim", "Jill"],
    "Percent": [0.5, 0.6, 0.7, 0.8],
    "Salary": [50000, 54000, 58000, 62000]
}

df = pd.DataFrame(data)

st.write(st.context.locale) # Here I get "pt-BR"

# Display the data frame
st.dataframe(df, column_config={"Name": st.column_config.TextColumn("Name"), "Percent": st.column_config.NumberColumn("Percent"), "Salary": st.column_config.NumberColumn("Salary")})

Steps To Reproduce

No response

Expected Behavior

Percentages should show as 0,5 / 0,6 / 0,7 / 0,8, and the salary column: 50.000, 54.000, 58.000, 62.000

Current Behavior

As displayed in the screenshot

Is this a regression?

  • Yes, this used to work in a previous version.

Debug info

  • Streamlit version: 1.45.0
  • Python version: Python 3.13.1
  • Operating System: Windows 11
  • Browser: Edge / Chrome

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature:st.column_configRelated to column configuration functionalitypriority:P2Medium-high priority - fix within one monthstatus:confirmedBug has been confirmed by the Streamlit teamtype:bugSomething isn't working as expected

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions