summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCraig Earls <enderw88@gmail.com>2013-02-21 14:35:29 -0700
committerCraig Earls <enderw88@gmail.com>2013-02-21 14:35:29 -0700
commit023e245e9b942968a5c61e494c28de2823b2a222 (patch)
treebbcf418f3248b17a83c01d77a32681815a55991a
parent2fd1574cf2e969c7da7bf346837d859ac6ae90c9 (diff)
downloadfork-ledger-023e245e9b942968a5c61e494c28de2823b2a222.tar.gz
fork-ledger-023e245e9b942968a5c61e494c28de2823b2a222.tar.bz2
fork-ledger-023e245e9b942968a5c61e494c28de2823b2a222.zip
Another attempt to deal with decimal-comma
-rw-r--r--lisp/ldg-commodities.el7
1 files changed, 4 insertions, 3 deletions
diff --git a/lisp/ldg-commodities.el b/lisp/ldg-commodities.el
index 1b6b332a..c832f375 100644
--- a/lisp/ldg-commodities.el
+++ b/lisp/ldg-commodities.el
@@ -44,13 +44,14 @@ This only has effect interfacing to calc mode in edit amount"
(with-temp-buffer
(insert str)
(goto-char (point-min))
- (re-search-forward "-?[1-9][0-9]*[.,][0-9]*")
+ (re-search-forward "-?[1-9][0-9]*[.,][0-9]*" nil t)
(setq val
(string-to-number
(ledger-commodity-string-number-decimalize
(delete-and-extract-region (match-beginning 0) (match-end 0)) :from-user)))
- (delete-trailing-whitespace)
- (setq comm (buffer-substring (point-min) (point-max)))
+ (re-search-forward "[^[:space:]]" nil t)
+ (setq comm
+ (delete-and-extract-region (match-beginning 0) (match-end 0)))
(list val comm))))