Skip to content

Commit

Permalink
fix(aggregations): min, max agg -ve num handling (#2736)
Browse files Browse the repository at this point in the history
  • Loading branch information
gargroh authored Sep 18, 2020
1 parent 47a4399 commit a86e404
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/aggregations.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export function sum(values, aggregatedValues) {
}

export function min(values) {
let min = 0
let min = values[0] || 0

values.forEach(value => {
if (typeof value === 'number') {
Expand All @@ -20,7 +20,7 @@ export function min(values) {
}

export function max(values) {
let max = 0
let max = values[0] || 0

values.forEach(value => {
if (typeof value === 'number') {
Expand All @@ -32,8 +32,8 @@ export function max(values) {
}

export function minMax(values) {
let min = 0
let max = 0
let min = values[0] || 0
let max = values[0] || 0

values.forEach(value => {
if (typeof value === 'number') {
Expand Down

1 comment on commit a86e404

@vercel
Copy link

@vercel vercel bot commented on a86e404 Sep 18, 2020

Choose a reason for hiding this comment

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

Please sign in to comment.