Skip to content

armgit / maybe

Public Imported from GitHub
0

The personal finance app for everyone

FIX: correct display of percentages (#1622)

tlinkae9287ec9bb1
diff --git a/app/models/family.rb b/app/models/family.rb
index fef014fe..f2f1b530 100644
--- a/app/models/family.rb
+++ b/app/models/family.rb
@@ -149,7 +149,7 @@ class Family < ApplicationRecord
savings << {
date: r.date,
- value: r.rolling_income != 0 ? (r.rolling_income - r.rolling_spend) / r.rolling_income : 0.to_d
+ value: r.rolling_income != 0 ? ((r.rolling_income - r.rolling_spend) / r.rolling_income) : 0.to_d
}
end
diff --git a/app/views/pages/dashboard.html.erb b/app/views/pages/dashboard.html.erb
index 06a9115e..fe6639fe 100644
--- a/app/views/pages/dashboard.html.erb
+++ b/app/views/pages/dashboard.html.erb
@@ -133,7 +133,7 @@
<%= render partial: "shared/value_heading", locals: {
label: t(".savings_rate"),
period: Period.last_30_days,
- value: @savings_rate_series.last&.value,
+ value: (@savings_rate_series.last&.value)*100,
trend: @savings_rate_series.trend,
is_percentage: true
} %>