mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-08-05 05:25:24 +02:00
Add trends to sidebar account list (#697)
This commit is contained in:
parent
93953499a6
commit
7f491f5064
12 changed files with 87 additions and 28 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue