diff --git a/src/rustint/core.clj b/src/rustint/core.clj index 6836fd0..ac1db21 100644 --- a/src/rustint/core.clj +++ b/src/rustint/core.clj @@ -2203,14 +2203,10 @@ ; [10] ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defn pasar-a-float [arg] - (if - (string? arg) - ( - try - (reduce #(+ (* 10 %1) %2) (map #(- %1 48) (map int (map char arg)))) - (catch ClassCastException e (arg)) - ) - arg + (cond + (number? arg) (float arg) + (string? arg) (if (re-find #"^-?\d+\.?\d*$" arg) (float (read-string arg)) arg) + :else (arg) ) )