lmi-commits
[Top][All Lists]
Advanced

[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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]