[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master 299cc249 22/27: Improve documentation
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master 299cc249 22/27: Improve documentation |
Date: |
Mon, 25 Apr 2022 12:56:18 -0400 (EDT) |
branch: master
commit 299cc2492b1c2c00d6fd8f658dd1007ea1f82d85
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>
Improve documentation
---
ledger_evaluator.cpp | 34 ++++++----------------------------
1 file changed, 6 insertions(+), 28 deletions(-)
diff --git a/ledger_evaluator.cpp b/ledger_evaluator.cpp
index f15de062..fb478a45 100644
--- a/ledger_evaluator.cpp
+++ b/ledger_evaluator.cpp
@@ -413,15 +413,15 @@ mask_map_t static_masks()
format_map_t static_formats()
{
-// Here's my top-level analysis of the formatting specification.
-//
// Formats
//
-// F0: zero decimals
+// F0: zero decimals, commas unnecessary: all small integers
// F1: zero decimals, commas
// F2: two decimals, commas
// F3: scaled by 100, zero decimals, with '%' at end:
// F4: scaled by 100, two decimals, with '%' at end:
+// F5: zero decimals, commas, cents to dollars
+// F6: two decimals, commas, cents to dollars
//
// Presumably all use commas as thousands-separators, so that
// an IRR of 12345.67% would be formatted as "12,345.67%".
@@ -429,6 +429,7 @@ format_map_t static_formats()
// So the differences are:
// 'precision' (number of decimal places)
// percentage (scaled by 100, '%' at end) or not
+// cents-to-dollars conversion (scaled by 100)
// and therefore F0 is equivalent to F1
std::pair<int,oenum_format_style> f1(0, oe_format_normal);
@@ -438,12 +439,10 @@ format_map_t static_formats()
std::pair<int,oenum_format_style> f5(0, oe_cents_as_dollars);
std::pair<int,oenum_format_style> f6(2, oe_cents_as_dollars);
+// Special Formatting for Scalar Items
static format_map_t const format_map =
-// > Special Formatting for Scalar Items
-// >
// F4: scaled by 100, two decimals, with '%' at end:
// > Format as percentage "0.00%"
-// >
{{"GuarMaxMandE" , f4}
,{"InitAnnGenAcctInt" , f4}
,{"InitAnnLoanCredRate" , f4}
@@ -469,19 +468,15 @@ format_map_t static_formats()
,{"SalesLoadRefundRate0" , f3}
,{"SalesLoadRefundRate1" , f3}
-// >
// F2: two decimals, commas
// > Format as a number with thousand separators and two decimal places
(#,###,###.00)
-// >
,{"CurrentCoiMultiplier" , f2}
,{"GuarPrem" , f2}
,{"InforceTaxBasis" , f2}
,{"InforceTotalAV" , f2}
,{"InitSevenPayPrem" , f2}
-// >
// F6: two decimals, commas, cents to dollars
// > Format as a number with thousand separators and two decimal places
(#,###,###.00)
-// >
,{"EeListBillPremium" , f6}
,{"ErListBillPremium" , f6}
,{"InitGLP" , f6}
@@ -489,10 +484,8 @@ format_map_t static_formats()
,{"InitPrem" , f6}
,{"InitTgtPrem" , f6}
,{"ListBillPremium" , f6}
-// >
// F1: zero decimals, commas
// > Format as a number with thousand separators and no decimal places
(#,###,###)
-// >
,{"Age" , f1}
,{"AllowGroupQuote" , f1}
,{"AvgFund" , f1}
@@ -541,10 +534,8 @@ format_map_t static_formats()
,{"TxCallsGuarUwSubstd" , f1}
,{"UsePartialMort" , f1}
,{"WriteTsvFile" , f1}
-// >
// F5: zero decimals, commas, cents to dollars
// > Format as a number with thousand separators and no decimal places
(#,###,###)
-// >
,{"Dumpin" , f5}
,{"External1035Amount" , f5}
,{"InitBaseSpecAmt" , f5}
@@ -553,22 +544,17 @@ format_map_t static_formats()
,{"Internal1035Amount" , f5}
// > Vector Formatting
-// >
-// > Here are the vectors enumerated
-// >
+
// F3: scaled by 100, zero decimals, with '%' at end:
// > Format as percentage with no decimal places (##0%)
-// >
,{"CorridorFactor" , f3}
,{"FundAllocations" , f3}
,{"MaleProportion" , f3}
,{"NonsmokerProportion" , f3}
,{"PartMortTableMult" , f3}
-// >
// F4: scaled by 100, two decimals, with '%' at end:
// > Format as percentage with two decimal places (##0.00%)
-// >
,{"AnnGAIntRate" , f4}
,{"AnnHoneymoonValueRate" , f4}
,{"AnnLoanDueRate" , f4}
@@ -601,25 +587,19 @@ format_map_t static_formats()
,{"MlyPostHoneymoonRate" , f4}
,{"MlySAIntRate" , f4}
,{"TotalIMF" , f4}
-// >
// F0: zero decimals
// > Format as a number no thousand separator or decimal point (##0%)
-// >
,{"AttainedAge" , f1}
,{"Duration" , f1}
,{"PolicyYear" , f1}
-// >
// F2: two decimals, commas
// > Format as a number with thousand separators and two decimal places
(#,###,###.00)
-// >
,{"AddonMonthlyFee" , f2}
,{"AnnualFlatExtra" , f2}
// TODO ?? The precision of 'InforceLives' is inadequate. Is every other
format OK?
,{"InforceLives" , f2}
-// >
// F1: zero decimals, commas
// > Format as a number with thousand separators and no decimal places
(#,###,##0)
-// >
,{"AVRelOnDeath" , f1}
,{"AccumulatedPremium" , f1}
,{"AddonCompOnAssets" , f1}
@@ -642,10 +622,8 @@ format_map_t static_formats()
,{"RefundableSalesLoad" , f1}
,{"Salary" , f1}
,{"SpouseRiderAmount" , f1}
-// >
// F5: zero decimals, commas, cents to dollars
// > Format as a number with thousand separators and no decimal places
(#,###,##0)
-// >
,{"AVGenAcct" , f5}
,{"AVSepAcct" , f5}
,{"AcctVal" , f5}
- [lmi-commits] [lmi] master 7b30e2d8 03/27: Filter unexpectedly small system-test discrepancies, (continued)
- [lmi-commits] [lmi] master 7b30e2d8 03/27: Filter unexpectedly small system-test discrepancies, Greg Chicares, 2022/04/25
- [lmi-commits] [lmi] master d7ab80c6 04/27: Clean up beforehand, not afterward, Greg Chicares, 2022/04/25
- [lmi-commits] [lmi] master 12192723 06/27: Add two new ledger emission options, Greg Chicares, 2022/04/25
- [lmi-commits] [lmi] master 119df7a9 13/27: Add a 'divisor' argument to LedgerBase::value_str(), Greg Chicares, 2022/04/25
- [lmi-commits] [lmi] master 2b108ed7 18/27: Avoid unnecessary rounding, Greg Chicares, 2022/04/25
- [lmi-commits] [lmi] master b7c61b4d 20/27: Regularize format names, Greg Chicares, 2022/04/25
- [lmi-commits] [lmi] master 8de190ce 17/27: Regularize whitespace, Greg Chicares, 2022/04/25
- [lmi-commits] [lmi] master 0b6a3b69 02/27: Avoid writing " \n", Greg Chicares, 2022/04/25
- [lmi-commits] [lmi] master 95b4e917 19/27: Remove an unnecessary comment, Greg Chicares, 2022/04/25
- [lmi-commits] [lmi] master 61f6a237 21/27: Reorder format-style map, Greg Chicares, 2022/04/25
- [lmi-commits] [lmi] master 299cc249 22/27: Improve documentation,
Greg Chicares <=
- [lmi-commits] [lmi] master 6f50ad93 23/27: Transpose a ledger format, Greg Chicares, 2022/04/25
- [lmi-commits] [lmi] master 00289fa7 25/27: Rearrange ledger formats, Greg Chicares, 2022/04/25
- [lmi-commits] [lmi] master 16898eb9 26/27: Use a more reasonable format for an unused field, Greg Chicares, 2022/04/25
- [lmi-commits] [lmi] master 09e00258 27/27: Mark or expunge unused fields, Greg Chicares, 2022/04/25