summaryrefslogtreecommitdiff
path: root/LedgerSMB
diff options
context:
space:
mode:
Diffstat (limited to 'LedgerSMB')
-rwxr-xr-xLedgerSMB/Form.pm8
1 files changed, 6 insertions, 2 deletions
diff --git a/LedgerSMB/Form.pm b/LedgerSMB/Form.pm
index 8c9cc51a..b42f7584 100755
--- a/LedgerSMB/Form.pm
+++ b/LedgerSMB/Form.pm
@@ -388,16 +388,20 @@ sub format_amount {
my ($self, $myconfig, $amount, $places, $dash) = @_;
+
my $negative = ($amount < 0);
+ print STDERR "$amount\n";
if ($amount){
$amount =~ s/-//;
$amount = $self->parse_amount($myconfig, $amount);
}
+ print STDERR "$amount\n";
if ($places =~ /\d+/) {
#$places = 4 if $places == 2;
$amount = $self->round_amount($amount, $places);
}
+ print STDERR "$amount\n";
# is the amount negative
@@ -489,7 +493,7 @@ sub parse_amount {
my ($self, $myconfig, $amount) = @_;
- if (!UNIVERSAL::isa($amount, 'Math::BigFloat')){ # Amount may not be an object
+ if (UNIVERSAL::isa($amount, 'Math::BigFloat')){ # Amount may not be an object
return $amount;
}
my $numberformat = $myconfig->{numberformat};
@@ -503,7 +507,7 @@ sub parse_amount {
($numberformat eq '1000,00')) {
$amount =~ s/\.//g;
- $amount =~ s/,/\./;
+ $amount =~ s/,/./;
}
if ($numberformat eq '1 000.00'){
$amount =~ s/\s//g;