summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/amount.cc3
-rw-r--r--src/report.h6
-rw-r--r--test/baseline/opt-unround.test94
3 files changed, 101 insertions, 2 deletions
diff --git a/src/amount.cc b/src/amount.cc
index 9dea532c..66934947 100644
--- a/src/amount.cc
+++ b/src/amount.cc
@@ -488,7 +488,10 @@ void amount_t::in_place_unround()
return;
_dup();
+
+ DEBUG("amount.unround", "Unrounding " << *this);
set_keep_precision(true);
+ DEBUG("amount.unround", "Unrounded = " << *this);
}
void amount_t::in_place_reduce()
diff --git a/src/report.h b/src/report.h
index da1a7c5a..45d4f11a 100644
--- a/src/report.h
+++ b/src/report.h
@@ -778,8 +778,10 @@ public:
});
OPTION_(report_t, unround, DO() {
- parent->HANDLER(amount_).set_expr(string("--uncleared"),
- "unrounded(amount)");
+ parent->HANDLER(display_amount_)
+ .set_expr(string("--unround"), "unrounded(amount_expr)");
+ parent->HANDLER(display_total_)
+ .set_expr(string("--unround"), "unrounded(total_expr)");
});
OPTION_(report_t, weekly, DO() { // -W
diff --git a/test/baseline/opt-unround.test b/test/baseline/opt-unround.test
new file mode 100644
index 00000000..70018f12
--- /dev/null
+++ b/test/baseline/opt-unround.test
@@ -0,0 +1,94 @@
+bal --unround --percent
+<<<
+2008/01/11 LIAT
+ Expenses:Travel:Airfare $40.00
+ Liabilities:MasterCard
+
+2008/01/14 cheaptickets.com
+ Expenses:Travel:Airfare $182.19
+ Liabilities:MasterCard
+
+2008/02/05 CTX
+ Expenses:Travel:Auto $240.38
+ Liabilities:MasterCard
+
+2008/02/05 UNITED
+ Expenses:Travel:Airfare $238.80
+ Liabilities:MasterCard
+
+2008/02/05 UNITED
+ Expenses:Travel:Airfare $238.80
+ Liabilities:MasterCard
+
+2008/02/22 BUDGET RENT-A-CAR
+ Expenses:Travel:Auto $40.59
+ Liabilities:MasterCard
+
+2008/03/16 IBERIA
+ Expenses:Travel:Airfare $1,231.60
+ Liabilities:MasterCard
+
+2008/03/16 IBERIA
+ Expenses:Travel:Airfare $1,231.60
+ Liabilities:MasterCard
+
+2008/04/03 AMERICAN
+ Expenses:Travel:Airfare $155.86
+ Liabilities:MasterCard
+
+2008/04/03 AMERICAN
+ Expenses:Travel:Airfare $155.86
+ Liabilities:MasterCard
+
+2008/04/30 UNITED
+ Expenses:Travel:Airfare $437.21
+ Liabilities:MasterCard
+
+2008/04/30 UNITED
+ Expenses:Travel:Airfare $437.21
+ Liabilities:MasterCard
+
+2008/08/08 BCIS I-131 FILING FEE-
+ Expenses:Travel:Passport $170.00
+ Liabilities:MasterCard
+
+2008/09/06 AMERICAN
+ Expenses:Travel:Airfare $912.60
+ Liabilities:MasterCard
+
+2008/09/06 AMERICAN
+ Expenses:Travel:Airfare $912.60
+ Liabilities:MasterCard
+
+2008/09/22 AGNT FEE
+ Expenses:Travel:Airfare $70.00
+ Liabilities:MasterCard
+
+2008/09/22 DELTA
+ Expenses:Travel:Airfare $806.20
+ Liabilities:MasterCard
+
+2008/09/22 DELTA
+ Expenses:Travel:Airfare $806.20
+ Liabilities:MasterCard
+
+2008/09/22 LIAT 1974 LIMITED
+ Expenses:Travel:Airfare $418.34
+ Liabilities:MasterCard
+
+2008/12/26 U.S. Department of State
+ Expenses:Travel:Passport $127.00
+ Assets:Checking
+
+2008/12/26 U.S. Department of State
+ Expenses:Travel:Passport $127.00
+ Assets:Checking
+>>>1
+ 100.00% Assets:Checking
+ 100.00% Expenses:Travel
+ 92.14958953% Airfare
+ 3.12882793% Auto
+ 4.72158253% Passport
+ 100.00% Liabilities:MasterCard
+>>>2
+=== 0