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

Add sum filter to standard filters #1722

Merged
merged 1 commit into from Jun 19, 2023
Merged

Conversation

adamklingbaum
Copy link
Contributor

@adamklingbaum adamklingbaum commented Jun 15, 2023

A new filter to sum the values of an array. Either an ordinary sum for an array of numeric values, or as the sum of property values for an array of objects.

{{ array | sum }}

or

{{ array | sum: {property} }}

Example usage

{{ card_balances | sum }} 

or

{{ articles | sum: 'comments_count' }} 

@adamklingbaum adamklingbaum force-pushed the klingbaum/sum-filter branch 4 times, most recently from 9cfbbb4 to e1d203d Compare June 15, 2023 19:38
@adamklingbaum adamklingbaum marked this pull request as ready for review June 15, 2023 19:40
Copy link
Contributor

@charlespwd charlespwd left a comment

Choose a reason for hiding this comment

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

LGTM! :)

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.

None yet

4 participants