summaryrefslogtreecommitdiff
path: root/t/02-number-handling.t
diff options
context:
space:
mode:
authoreinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2007-05-06 19:16:51 +0000
committereinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2007-05-06 19:16:51 +0000
commit49cfee93420a50d15cd0168a92742bee61bc43e1 (patch)
tree02f00f6aaaaa92b20f7135ff0e8790d1469fcd59 /t/02-number-handling.t
parent2733306689a0bdb6f6585dc482fdafca889171f0 (diff)
Fixing rounding tests
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@1136 4979c152-3d1c-0410-bac9-87ea11338e46
Diffstat (limited to 't/02-number-handling.t')
-rw-r--r--t/02-number-handling.t2
1 files changed, 2 insertions, 0 deletions
diff --git a/t/02-number-handling.t b/t/02-number-handling.t
index 4add3b1f..5b694b1d 100644
--- a/t/02-number-handling.t
+++ b/t/02-number-handling.t
@@ -19,11 +19,13 @@ foreach my $value ('0.01', '0.05', '0.015', '0.025', '1.1', '1.5', '1.9',
foreach my $places ('3', '2', '1', '0') {
Math::BigFloat->round_mode('+inf');
$expected = Math::BigFloat->new($value)->ffround(-$places);
+ $expected->precision(undef);
is($form->round_amount($value, $places), $expected,
"$value to $places decimal places - $expected");
Math::BigFloat->round_mode('-inf');
$expected = Math::BigFloat->new(-$value)->ffround(-$places);
+ $expected->precision(undef);
is($form->round_amount(-$value, $places), $expected,
"-$value to $places decimal places - $expected");
}