diff options
Diffstat (limited to 'LedgerSMB/Form.pm')
-rwxr-xr-x | LedgerSMB/Form.pm | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/LedgerSMB/Form.pm b/LedgerSMB/Form.pm index 041be3ce..7508fd83 100755 --- a/LedgerSMB/Form.pm +++ b/LedgerSMB/Form.pm @@ -406,8 +406,9 @@ sub format_amount { if ($myconfig->{numberformat}) { + $amount =~ s/-//; + $self->parse_amount($amount); my ($whole, $dec) = split /\./, "$amount"; - $whole =~ s/-//; $amount = join '', reverse split //, $whole; if ($places) { @@ -422,6 +423,13 @@ sub format_amount { $amount .= "\.$dec" if ($dec ne ""); } + if ($myconfig->{numberformat} eq '1 000.00') { + $amount =~ s/\d{3,}?/$& /g; + $amount =~ s/\s$//; + $amount = join '', reverse split //, $amount; + $amount .= "\.$dec" if ($dec ne ""); + } + if ($myconfig->{numberformat} eq "1'000.00") { $amount =~ s/\d{3,}?/$&'/g; $amount =~ s/'$//; |