[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SF.net SVN: ledger-smb: [239] trunk/LedgerSMB/Form.pm



Revision: 239
          http://svn.sourceforge.net/ledger-smb/?rev=239&view=rev
Author:   einhverfr
Date:     2006-10-19 21:13:34 -0700 (Thu, 19 Oct 2006)

Log Message:
-----------
Added formating for 1 000.00 numbers

Modified Paths:
--------------
    trunk/LedgerSMB/Form.pm

Modified: trunk/LedgerSMB/Form.pm
===================================================================
--- trunk/LedgerSMB/Form.pm	2006-10-19 22:10:55 UTC (rev 238)
+++ trunk/LedgerSMB/Form.pm	2006-10-20 04:13:34 UTC (rev 239)
@@ -406,8 +406,9 @@
 
 		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 @@
 				$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/'$//;


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.