diff options
author | einhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46> | 2006-10-20 04:13:34 +0000 |
---|---|---|
committer | einhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46> | 2006-10-20 04:13:34 +0000 |
commit | ee00a747d4c7ccccb0dce54100abb12997d334fc (patch) | |
tree | 3b677699523e8e83d71ba560df308fa094183be0 | |
parent | d8bca7a8de34d31fea174dce5cc201b062eb3055 (diff) |
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
-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/'$//; |