Ver código fonte

[finance] fix nil in /hodl

Innokentiy Enikeev 7 anos atrás
pai
commit
9f30abeec1
1 arquivos alterados com 4 adições e 4 exclusões
  1. 4 4
      plugins/finance.lisp

+ 4 - 4
plugins/finance.lisp

@@ -274,8 +274,8 @@
 (defun handle-hodl-buy (chat-id from args)
   (handler-case
       (let ((symbol (get-label-symbol (nth 1 args)))
-            (amount (parse-float (nth 2 args)))
-            (open (parse-float (nth 3 args)))
+            (amount (* (parse-float (nth 2 args)) 1))
+            (open (* (parse-float (nth 3 args)) 1))
             (open-at (if (nth 4 args) (local-time:parse-timestring (nth 4 args)) (local-time:now))))
         (db/order-buy chat-id (agets from "id") (agets from "username")
                       symbol (princ-to-string amount) (princ-to-string open)
@@ -288,8 +288,8 @@
 (defun handle-hodl-sell (chat-id from args)
   (handler-case
       (let* ((symbol (get-label-symbol (nth 1 args)))
-             (amount (parse-float (nth 2 args)))
-             (close (parse-float (nth 3 args)))
+             (amount (* (parse-float (nth 2 args)) 1))
+             (close (* (parse-float (nth 3 args)) 1))
              (close-at (if (nth 4 args) (local-time:parse-timestring (nth 4 args)) (local-time:now)))
              (user-id (agets from "id"))
              (orders (db/orders-get chat-id user-id symbol t))