diff options
author | Craig Earls <enderw88@gmail.com> | 2013-02-26 15:37:15 -0700 |
---|---|---|
committer | Craig Earls <enderw88@gmail.com> | 2013-02-26 15:37:15 -0700 |
commit | a40d9f721fa237ed61b6dda7d18e86d18d150db7 (patch) | |
tree | 686289505b3986e26cef942566eed444c8492897 /lisp/ldg-commodities.el | |
parent | 929175216dc55544c8c5911902014c7727a95fd7 (diff) | |
parent | 5e0e7e0a973f8a323decbf818e66a6af3ba218fd (diff) | |
download | fork-ledger-a40d9f721fa237ed61b6dda7d18e86d18d150db7.tar.gz fork-ledger-a40d9f721fa237ed61b6dda7d18e86d18d150db7.tar.bz2 fork-ledger-a40d9f721fa237ed61b6dda7d18e86d18d150db7.zip |
Merge branch 'next' into ledger-mode-automatic-transactions
Diffstat (limited to 'lisp/ldg-commodities.el')
-rw-r--r-- | lisp/ldg-commodities.el | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lisp/ldg-commodities.el b/lisp/ldg-commodities.el index 14cc168f..612350b3 100644 --- a/lisp/ldg-commodities.el +++ b/lisp/ldg-commodities.el @@ -36,7 +36,6 @@ This only has effect interfacing to calc mode in edit amount" :type 'boolean :group 'ledger) - (defun ledger-split-commodity-string (str) "Split a commoditized amount into two parts" (let (val @@ -85,7 +84,7 @@ DIRECTION can be :to-user or :from-user. All math calculations are done with decimal-period, some users may prefer decimal-comma which must be translated both directions." (let ((val number-string)) - (if ledger-use-decimal-comma + (if (assoc "decimal-comma" ledger-environment-alist) (cond ((eq direction :from-user) ;; change string to decimal-period (while (string-match "," val) @@ -95,7 +94,9 @@ which must be translated both directions." (while (string-match "\\." val) (setq val (replace-match "," nil nil val)))) ;; gets rid of periods (t - (error "ledger-commodity-string-number-decimalize: direction not properly specified %S" direction)))) + (error "ledger-commodity-string-number-decimalize: direction not properly specified %S" direction))) + (while (string-match "," val) + (setq val (replace-match "" nil nil val)))) val)) |