-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Commas can't be removed from numbers in st.dataframe #8695
Comments
#8708 will change the number column to always use the raw value when copying or within the cell overlay. The thousand separator can also be removed from the cell rendering by using the number column formatting: st.dataframe(
{
"value": [10000, 13123.41, 21312341.123, 4123],
},
column_config={"value": st.column_config.NumberColumn(format="%f")},
) Its a reasonable consideration to don't use a thousand separator as default or to make this configurable within the format syntax. However, that will likely take a bit more effort since our formatting syntax ( |
st.dataframe
st.dataframe
via number column format
paramter
Oh, I just saw that there is another feature request related to the thousand separator here: #7702 Therefore, I will close this issue with the linked PR and keep the other feature request open. |
st.dataframe
via number column format
paramter## Describe your changes This PR enforces that the raw number value is used in the cell overlay and as copy value without any formatting applied. This was always supposed to be the case, but wasn't fully enforced in the number column yet. [Demo](https://number-column-fix.streamlit.app/) ## GitHub Issue Link (if applicable) - Closes #8695 ## Testing Plan - Added unit test and updated tests. --- **Contribution License Agreement** By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.
Checklist
Summary
Numbers are displayed in st.dataframe with commas and cannot be changed via ColumnConfig.
Reproducible Code Example
Steps To Reproduce
No response
Expected Behavior
We need to be able to change this via ColumnConfig. IMO, the default should be without and we should make it easy to add commas like this.
data_df, column_config={ format=",", ) }
Current Behavior
Numbers are automatically formatted as 1,000,000
Is this a regression?
Debug info
Additional Information
No response
The text was updated successfully, but these errors were encountered: