Skip to content
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: support locale formatting using d3 locale #6119

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

djbarnwal
Copy link
Member

@djbarnwal djbarnwal commented Nov 21, 2024

Integrate format_d3_locale in the UI. This enables support for all currencies, grouping, thousands string, decimal string etc.
image

Usage details here

https://d3js.org/d3-format#formatLocale

@djbarnwal djbarnwal self-assigned this Nov 21, 2024
Copy link
Contributor

@ericpgreen2 ericpgreen2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sweet! I'll approve, so you can merge when ready.

UXQA: with the following spec...
image
... I see the Big Number uses my provided currency, but the leaderboards nor pivot table do not.
image
image

"minus": { "type": "string", "description": "Optional minus sign (defaults to \"−\")." },
"nan": { "type": "string", "description": "Optional value for not-a-number (defaults to \"NaN\")." }
},
"required": ["decimal", "thousands", "grouping", "currency"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think these should all be required. Shouldn't we be able to provide a subset?
image

import { format as d3format } from "d3-format";
import {
format as d3format,
formatLocale,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: formatLocale as d3FormatLocale for symmetry with the line above?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants