summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2006-10-27 20:52:52 +0000
committereinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2006-10-27 20:52:52 +0000
commit45d9674323d8828c71a807ba5d23173868dea298 (patch)
tree249f637f7ab367aef49b812349486c772276c7d2
parenta3c58a38620e82d8ba0b536c9d062e1c49846225 (diff)
Corrected bug in nan comparison in test suite
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@343 4979c152-3d1c-0410-bac9-87ea11338e46
-rwxr-xr-xLedgerSMB/Form.pm4
-rw-r--r--t/02-number-handling.t2
2 files changed, 3 insertions, 3 deletions
diff --git a/LedgerSMB/Form.pm b/LedgerSMB/Form.pm
index d3ed1ff4..989b4ad9 100755
--- a/LedgerSMB/Form.pm
+++ b/LedgerSMB/Form.pm
@@ -520,10 +520,10 @@ sub parse_amount {
$amount =~ s/,//g;
if ($amount =~ s/\((\d*\.?\d*)\)/$1/){
- $amount *= -1;
+ $amount = $1 * -1;
}
if ($amount =~ s/(\d*\.?\d*) DR/$1/){
- $amount *= -1;
+ $amount = $1 * -1;
}
$amount =~ s/ CR//;
$amount = new Math::BigFloat($amount);
diff --git a/t/02-number-handling.t b/t/02-number-handling.t
index 0a6b43dc..8ad787aa 100644
--- a/t/02-number-handling.t
+++ b/t/02-number-handling.t
@@ -158,6 +158,6 @@ foreach my $format (0 .. $#formats) {
is($form->parse_amount(\%myconfig, ''), undef,
"Empty string returns undef");
- cmp_ok($form->parse_amount(\%myconfig, 'foo'), '==',
+ cmp_ok($form->parse_amount(\%myconfig, 'foo'), 'eq',
Math::BigFloat->bnan(), "Invalid string returns NaN");
}