1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-08-05 13:35:21 +02:00

Add trends to sidebar account list (#697)

This commit is contained in:
Josh Brown 2024-04-29 14:56:38 +01:00 committed by GitHub
parent 93953499a6
commit 7f491f5064
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 87 additions and 28 deletions

View file

@ -39,8 +39,8 @@ class TimeSeries::Trend
elsif previous.zero?
Float::INFINITY
else
change = (current_amount - previous_amount).abs
base = previous_amount.abs.to_f
change = (current_amount - previous_amount)
base = previous_amount.to_f
(change / base * 100).round(1).to_f
end