fix negative DECIMAL w/ fraction on mysql

This commit is contained in:
Ryan Culpepper 2013-12-28 00:06:44 -05:00
parent 1b2e5bdfc9
commit 464811eae8

View File

@ -749,10 +749,11 @@ computed string on the server can be. See also:
;; big integer
=> (lambda (m)
(string->number s))]
[(regexp-match #rx"^-?([0-9]*)\\.([0-9]*)$" s)
[(regexp-match #rx"^(-)?([0-9]*)\\.([0-9]*)$" s)
=> (lambda (m)
(+ (string->number (cadr m))
(parse-exact-fraction (caddr m))))]
(* (if (cadr m) -1 1)
(+ (string->number (caddr m))
(parse-exact-fraction (cadddr m)))))]
[else
(error/internal* 'parse-decimal "cannot parse as decimal"
'("string" value) s)]))