-
Notifications
You must be signed in to change notification settings - Fork 4k
[feat] Add Japanese yen as a NumberColumn & ProgressColumn format option
#11588
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
[feat] Add Japanese yen as a NumberColumn & ProgressColumn format option
#11588
Conversation
🎉 Snyk checks have passed. No issues have been found so far.✅ security/snyk check is complete. No issues have been found. (View Details) ✅ license/snyk check is complete. No issues have been found. (View Details) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds a new "yen" formatting option to both NumberColumn and ProgressColumn, enabling display of Japanese yen amounts consistently across the app.
- Added "yen" formatting option in the column types and updated related docstrings.
- Updated the UI formatting menu and added unit/e2e tests for the new option.
- Extended the utilities to support yen formatting via Intl.NumberFormat with zero fraction digits.
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| lib/streamlit/elements/lib/column_types.py | Updated option lists and docstrings for NumberColumn and ProgressColumn to include "yen". |
| frontend/lib/src/components/widgets/DataFrame/menus/FormattingMenu.tsx | Added "yen" entry to the formatting menu. |
| frontend/lib/src/components/widgets/DataFrame/menus/FormattingMenu.test.tsx | Added test assertion to check for the display of "Yen". |
| frontend/lib/src/components/widgets/DataFrame/columns/utils.ts | Added "yen" branch in the number formatting utility using currency JPY. |
| frontend/lib/src/components/widgets/DataFrame/columns/utils.test.ts | Introduced tests to verify the yen formatting outputs. |
| frontend/lib/src/components/widgets/DataFrame/columns/ProgressColumn.test.ts | Added test case to validate yen formatting for ProgressColumn. |
| frontend/lib/src/components/widgets/DataFrame/columns/NumberColumn.test.ts | Added test case to validate yen formatting for NumberColumn. |
| e2e_playwright/st_dataframe_config.py | Extended configuration to include a test for the "yen" format. |
sfc-gh-bnisco
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @alexmalins , thank you for your contribution! This seems like a handy addition to our library. This PR is failing due to updates in the snapshots. Can you please update the snapshots and add them to this branch in order for tests to pass? Directions on how to do so can be found in our contribution docs: https://github.com/streamlit/streamlit/wiki/Running-e2e-tests-and-updating-snapshots#updating-screenshots Thanks!
f1756fe to
12998c2
Compare
|
done thanks @sfc-gh-bnisco 🙌 Edit: still seeing some test failures: https://github.com/streamlit/streamlit/actions/runs/15610623649 |
`ProgressColumn` `format` option
12998c2 to
2306a3e
Compare
|
@alexmalins Thank you for the updates! I merged latest |
Describe your changes
Adds
format="yen"option for NumberColumn & ProgressColumn for displaying Japanese Yen (¥).This is an equivalent option to the existing
"dollar"and"euro"options.The motivation for this is it appears difficult with the printf-style formatting to format yen amounts with a ¥ char first, commas as thousandths separators, and minus in front of ¥ if the amount is negative.
Minimal code example:
GitHub Issue Link (if applicable)
Testing Plan
Added new NumberColumn, ProgressColumn and dataframe utils JS 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.