diff --git a/Pages/Portfolio.razor b/Pages/Portfolio.razor
index 9d626f0..a403f73 100644
--- a/Pages/Portfolio.razor
+++ b/Pages/Portfolio.razor
@@ -114,7 +114,7 @@ Portfolio@(stepPath==null?": review":": "+stepPath.Replace('-',' ')) - bogle.too
case "retirement-assets":
@((MarkupString)bold("Portfolio Size:")) @(formatMoney(familyData.Value))
- .
+ Change: @formatMoney(portfolioChange())
@if (familyData.Accounts.Count > 0) {
@@ -1228,12 +1228,12 @@ Portfolio@(stepPath==null?": review":": "+stepPath.Replace('-',' ')) - bogle.too
private double? portfolioChange()
{
- double change = 0.0;
+ double? change = 0.0;
foreach (var investment in familyData.GroupedInvestments)
{
if (investment.PercentChange != null)
{
- change += (investment.Price ?? 0.0 - investment.PreviousClose ?? 0.0) * investment.Shares ?? 0.0;
+ change += (investment.Price - investment.PreviousClose) * investment.Shares;
}
}
diff --git a/Shared/Models/FamilyData/FamilyData.cs b/Shared/Models/FamilyData/FamilyData.cs
index 814c4d4..27fce36 100644
--- a/Shared/Models/FamilyData/FamilyData.cs
+++ b/Shared/Models/FamilyData/FamilyData.cs
@@ -349,7 +349,7 @@ public List GroupedInvestments {
Investment? matchingInvestment;
if (!_GroupedInvestments.ContainsKey(key))
{
- matchingInvestment = new Investment() { Name = investment.Name, Ticker = investment.Ticker, PercentChange = investment.PercentChange, LastUpdated = investment.LastUpdated, Shares = 0.0, Price = investment.Price, Value = 0.0 };
+ matchingInvestment = new Investment() { Name = investment.Name, Ticker = investment.Ticker, PercentChange = investment.PercentChange, LastUpdated = investment.LastUpdated, Shares = 0.0, Price = investment.Price, PreviousClose = investment.PreviousClose, Value = 0.0 };
_GroupedInvestments.Add(key, matchingInvestment);
}
else
|