[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master 6a6ebe3 11/15: Adapt to currency class
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master 6a6ebe3 11/15: Adapt to currency class |
Date: |
Mon, 25 Jan 2021 09:58:06 -0500 (EST) |
branch: master
commit 6a6ebe306045596a39c5a3144c7d3f1cc667bdd3
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>
Adapt to currency class
---
account_value.hpp | 4 +++-
ihs_avdebug.cpp | 14 +++++++++++---
2 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/account_value.hpp b/account_value.hpp
index 83ddf91..8ce044a 100644
--- a/account_value.hpp
+++ b/account_value.hpp
@@ -304,7 +304,9 @@ class LMI_SO AccountValue final
void SetMonthlyDetail(int enumerator, std::string const&);
void SetMonthlyDetail(int enumerator, double);
-// void SetMonthlyDetail(int enumerator, currency); // CURRENCY !! later...
+#if defined USE_CURRENCY_CLASS
+ void SetMonthlyDetail(int enumerator, currency);
+#endif // defined USE_CURRENCY_CLASS
void DebugPrintInit();
void DebugEndBasis();
diff --git a/ihs_avdebug.cpp b/ihs_avdebug.cpp
index c3a9403..20be072 100644
--- a/ihs_avdebug.cpp
+++ b/ihs_avdebug.cpp
@@ -257,6 +257,14 @@ inline void AccountValue::SetMonthlyDetail(int enumerator,
double d)
}
//============================================================================
+#if defined USE_CURRENCY_CLASS
+inline void AccountValue::SetMonthlyDetail(int enumerator, currency c)
+{
+ DebugRecord[enumerator] = value_cast<std::string>(dblize(c));
+}
+#endif // defined USE_CURRENCY_CLASS
+
+//============================================================================
void AccountValue::SetDebugFilename(std::string const& s)
{
configurable_settings const& c = configurable_settings::instance();
@@ -413,12 +421,12 @@ void AccountValue::DebugPrint()
SetMonthlyDetail(eCumNoLapsePrem ,CumNoLapsePrem );
SetMonthlyDetail(eNoLapseActive ,NoLapseActive );
SetMonthlyDetail(eEOMAV ,TotalAccountValue() );
- SetMonthlyDetail(eHMValue ,std::max(HoneymoonValue, 0.0) );
+ SetMonthlyDetail(eHMValue ,std::max(HoneymoonValue, C0) );
SetMonthlyDetail(eSurrChg ,SurrChg() );
// TODO ?? Unfortunately duplicated from AccountValue::FinalizeYear().
- double total_av = TotalAccountValue();
- double csv_net =
+ currency total_av = TotalAccountValue();
+ currency csv_net =
total_av
- SurrChg()
- RegLnBal
- [lmi-commits] [lmi] master updated (a111350 -> 9d991b0), Greg Chicares, 2021/01/25
- [lmi-commits] [lmi] master 6d719d2 10/15: Refactor an assertion, Greg Chicares, 2021/01/25
- [lmi-commits] [lmi] master 2084088 09/15: Record speed measurements, Greg Chicares, 2021/01/25
- [lmi-commits] [lmi] master da240e8 03/15: Eliminate a return code that was always zero, Greg Chicares, 2021/01/25
- [lmi-commits] [lmi] master d280c59 05/15: Fix a unit test, Greg Chicares, 2021/01/25
- [lmi-commits] [lmi] master 7b51fab 07/15: Adapt to currency class, Greg Chicares, 2021/01/25
- [lmi-commits] [lmi] master f7a1129 08/15: Store policy fees as currency, Greg Chicares, 2021/01/25
- [lmi-commits] [lmi] master 2666c48 06/15: Test rounding double to currency, Greg Chicares, 2021/01/25
- [lmi-commits] [lmi] master 5ed8f75 04/15: Refactor a unit test, Greg Chicares, 2021/01/25
- [lmi-commits] [lmi] master 6a6ebe3 11/15: Adapt to currency class,
Greg Chicares <=
- [lmi-commits] [lmi] master 1d5c923 01/15: Change some internal names, Greg Chicares, 2021/01/25
- [lmi-commits] [lmi] master 1e5d1ea 12/15: Adapt to currency class, Greg Chicares, 2021/01/25
- [lmi-commits] [lmi] master 27bd748 13/15: Write $0.00 as a currency rather than floating-point constant, Greg Chicares, 2021/01/25
- [lmi-commits] [lmi] master 9d991b0 15/15: Round currency as such, Greg Chicares, 2021/01/25
- [lmi-commits] [lmi] master 306ba4e 02/15: Introduce optional (for now) currency class, Greg Chicares, 2021/01/25
- [lmi-commits] [lmi] master fd106fc 14/15: Reformat, Greg Chicares, 2021/01/25