fix bounce_rate change bug (#3886)

This commit is contained in:
RobertJoonas 2024-03-12 10:46:23 +00:00 committed by GitHub
parent 7641c66a2b
commit 6eef32a8ff
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -4,7 +4,9 @@ defmodule Plausible.Stats.Compare do
end
def calculate_change(:bounce_rate, old_count, new_count) do
if old_count > 0, do: new_count - old_count
if is_integer(old_count) && is_integer(new_count) && old_count > 0 do
new_count - old_count
end
end
def calculate_change(_metric, old_count, new_count) do