Another attempt to deal with decimal-comma

This commit is contained in:
Craig Earls 2013-02-21 14:35:29 -07:00
parent 2fd1574cf2
commit 023e245e9b

View file

@ -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))))