From ee00a747d4c7ccccb0dce54100abb12997d334fc Mon Sep 17 00:00:00 2001 From: einhverfr Date: Fri, 20 Oct 2006 04:13:34 +0000 Subject: Added formating for 1 000.00 numbers git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@239 4979c152-3d1c-0410-bac9-87ea11338e46 --- LedgerSMB/Form.pm | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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/'$//; -- cgit v1.2.3