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

count: format toLocaleString #173

Merged
merged 1 commit into from
Jan 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ const ValueElement = (props) => {
} = props;
const label = bucket.label
? bucket.label
: `${keyField} (${bucket.doc_count})`;
: `${keyField} (${bucket.doc_count.toLocaleString('en-US')})`;
Copy link
Member

Choose a reason for hiding this comment

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

I guess is fine for now to stick to en-Us locale but we should definitely integrate proper internationalization for this!

const childAggCmps = getChildAggCmps(bucket);
return (
<Overridable
Expand Down
2 changes: 1 addition & 1 deletion src/lib/components/Count/Count.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const Element = ({ totalResults, overridableId }) => (
id={buildUID('Count.element', overridableId)}
totalResults={totalResults}
>
<Label color={'blue'}>{totalResults}</Label>
<Label color={'blue'}>{totalResults.toLocaleString('en-US')}</Label>
</Overridable>
);

Expand Down