fix(compare): logic was wrong
We did $old - $new instead of $new - $old so positive changes where good and negative where bad T-T
This commit is contained in:
parent
cd38cd76fd
commit
ea9ec51d18
1 changed files with 2 additions and 2 deletions
|
@ -1,8 +1,8 @@
|
||||||
# Calculate the change in percentage of a nummeric key
|
# Calculate the change in percentage of a numeric key
|
||||||
#
|
#
|
||||||
# Where .[0] is the new value, and .[1] is the old value
|
# Where .[0] is the new value, and .[1] is the old value
|
||||||
def calc_change($key):
|
def calc_change($key):
|
||||||
. as $input | $input[1][$key] - $input[0][$key];
|
. as $input | $input[0][$key] - $input[1][$key];
|
||||||
|
|
||||||
# Calculate the change in percentage for multiple keys
|
# Calculate the change in percentage for multiple keys
|
||||||
#
|
#
|
||||||
|
|
Loading…
Reference in a new issue