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:
Jalil David Salamé Messina 2024-12-19 23:36:50 +01:00
parent cd38cd76fd
commit ea9ec51d18
Signed by: jalil
GPG key ID: F016B9E770737A0B

View file

@ -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
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
#