Skip to content

Commit

Permalink
handle percent in the model, not view
Browse files Browse the repository at this point in the history
  • Loading branch information
rrelyea committed Jun 9, 2024
1 parent 8fc8bff commit 4807118
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions Pages/AccountView.razor
Original file line number Diff line number Diff line change
Expand Up @@ -376,8 +376,8 @@ else if (loaded && appData?.FamilyData is not null)
</td>
@if (investment.IsIBond)
{
<td style=text-align:right>@FormatUtilities.FormatPercent3(investment.InterestRate * 100.0)</td>
<td style=text-align:right>@FormatUtilities.FormatPercent3(investment.CurrentRate * 100.0)</td>
<td style=text-align:right>@FormatUtilities.FormatPercent3(investment.InterestRate)</td>
<td style=text-align:right>@FormatUtilities.FormatPercent3(investment.CurrentRate)</td>
}
else
{
Expand All @@ -395,7 +395,7 @@ else if (loaded && appData?.FamilyData is not null)
as of @FormatUtilities.FormatMonthPlus2DigitYear(@investment.NextRateStart):
</td>
<td style=text-align:right>
@FormatUtilities.FormatPercent3(investment.NextRate * 100.0)
@FormatUtilities.FormatPercent3(investment.NextRate)
</td>
<td></td>
</tr>
Expand Down
6 changes: 3 additions & 3 deletions Pages/Portfolio.razor
Original file line number Diff line number Diff line change
Expand Up @@ -450,8 +450,8 @@ else if (appData is not null && appData.FamilyData is not null)
</td>
@if (investment.IsIBond)
{
<td style=text-align:right>@FormatUtilities.FormatPercent3(investment.InterestRate * 100.0)</td>
<td style=text-align:right>@FormatUtilities.FormatPercent3(investment.CurrentRate * 100.0)</td>
<td style=text-align:right>@FormatUtilities.FormatPercent3(investment.InterestRate)</td>
<td style=text-align:right>@FormatUtilities.FormatPercent3(investment.CurrentRate)</td>
}
else
{
Expand All @@ -470,7 +470,7 @@ else if (appData is not null && appData.FamilyData is not null)
as of @FormatUtilities.FormatMonthPlus2DigitYear(@investment.NextRateStart):
</td>
<td style=text-align:right>
@FormatUtilities.FormatPercent3(investment.NextRate * 100.0)
@FormatUtilities.FormatPercent3(investment.NextRate)
</td>
<td></td>
</tr>
Expand Down
6 changes: 3 additions & 3 deletions library/Models/FamilyData/Investment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -600,11 +600,11 @@ static string GetRateDate(int month, int year)
i--;
}

InterestRate = rates[0];
CurrentRate = monthsToCompoundThisRound != 6 ? currentRate : rates[i];
InterestRate = rates[0] * 100.0;
CurrentRate = monthsToCompoundThisRound != 6 ? currentRate * 100.0 : rates[i] * 100.0;
if (monthsToCompoundThisRound != 6 && i > 0)
{
NextRate = rates[i];
NextRate = rates[i] * 100.0;
var nextMonthStart = nowMonth + 6 - monthsToCompoundThisRound + 1;
var nextYearStart = nowYear;
if (nextMonthStart > 12)
Expand Down

0 comments on commit 4807118

Please sign in to comment.