summaryrefslogtreecommitdiff
path: root/test/unit/t_amount.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-02-24 15:13:21 -0400
committerJohn Wiegley <johnw@newartisans.com>2009-02-24 15:13:21 -0400
commitf13709f71afec388f5dcc00f6fb468917390927d (patch)
treea1d5305fd6407b2257e3dfc4d38d71ac99431183 /test/unit/t_amount.cc
parent1ecf62ce25e01def8a0df0a7c59047148c2cd734 (diff)
downloadfork-ledger-f13709f71afec388f5dcc00f6fb468917390927d.tar.gz
fork-ledger-f13709f71afec388f5dcc00f6fb468917390927d.tar.bz2
fork-ledger-f13709f71afec388f5dcc00f6fb468917390927d.zip
Be smarter about printing uncommoditized amounts
Diffstat (limited to 'test/unit/t_amount.cc')
-rw-r--r--test/unit/t_amount.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/test/unit/t_amount.cc b/test/unit/t_amount.cc
index 7e0f53b0..5e673e7c 100644
--- a/test/unit/t_amount.cc
+++ b/test/unit/t_amount.cc
@@ -850,11 +850,11 @@ void AmountTestCase::testIntegerDivision()
assertEqual(amount_t(0L), amount_t(0L) / x1);
assertEqual(amount_t(0L), 0L / x1);
assertEqual(x1, x1 / 1L);
- assertEqual(string("0.008130"), (amount_t(1L) / x1).to_string());
- assertEqual(string("0.008130"), (1L / x1).to_string());
+ assertEqual(string("0.00813"), (amount_t(1L) / x1).to_string());
+ assertEqual(string("0.00813"), (1L / x1).to_string());
assertEqual(- x1, x1 / -1L);
- assertEqual(string("-0.008130"), (amount_t(-1L) / x1).to_string());
- assertEqual(string("-0.008130"), (-1L / x1).to_string());
+ assertEqual(string("-0.00813"), (amount_t(-1L) / x1).to_string());
+ assertEqual(string("-0.00813"), (-1L / x1).to_string());
assertEqual(string("0.269737"), (x1 / y1).to_string());
assertEqual(string("3.707317"), (y1 / x1).to_string());
assertEqual(string("0.269737"), (x1 / 456L).to_string());
@@ -906,7 +906,7 @@ void AmountTestCase::testFractionalDivision()
x1 /= amount_t("456.456");
assertEqual(string("0.000590937225286255757169884601508201951"), x1.to_string());
x1 /= 456L;
- assertEqual(string("0.000001295914967733017011337466214297678193292890066687335298289595263924317558590360"), x1.to_string());
+ assertEqual(string("0.00000129591496773301701133746621429767819329289006668733529828959526392431755859036"), x1.to_string());
amount_t x4("1234567891234567.89123456789");
amount_t y4("56.789");