diff --git a/compare.jq b/compare.jq index 326b4de..88a366e 100644 --- a/compare.jq +++ b/compare.jq @@ -2,7 +2,7 @@ # # Where .[0] is the new value, and .[1] is the old value def calc_change($key): - . as $input | $input[0][$key] - $input[1][$key]; + . as $input | ($input[0][$key] // 0) - ($input[1][$key] // 0); # Calculate the change in percentage for multiple keys #