From e6cd1fedf2522e58a38a51eaa676f59094da8249 Mon Sep 17 00:00:00 2001 From: Will Hawkins Date: Thu, 12 May 2022 15:43:41 -0400 Subject: [Functionality] Change definition of percent change Switch from calculating "difference" as percent difference to calculating the difference as percent change. --- utilities/utilities.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'utilities/utilities.go') diff --git a/utilities/utilities.go b/utilities/utilities.go index b1b180f..4b114ba 100644 --- a/utilities/utilities.go +++ b/utilities/utilities.go @@ -32,7 +32,10 @@ func SignedPercentDifference( current float64, previous float64, ) (difference float64) { - return ((current - previous) / (float64(current+previous) / 2.0)) * float64( + //return ((current - previous) / (float64(current+previous) / 2.0)) * float64( + //100, + // ) + return ((current - previous) / previous) * float64( 100, ) } -- cgit v1.2.3