I am catching a number from path-params in my luminus project (the variable hyra) with the following code:
(defn btable2 [{:keys [params path-params]}]
(let [spara (:spara path-params)
hyra (Long/parseLong (:hyra params))
tarea (Long/parseLong (:tarea params))
omk (Long/parseLong (:omk params))
barea (Long/parseLong (:barea params))
parea (Long/parseLong (:parea params))
tarea (Long/parseLong (:tarea params))
notes (:notes params)
totk (/ (/ (* (+ (/ hyra tarea) (/ omk tarea)) (+ parea barea) 15.0) 10.0))
totk2 (Math/round (* 100000 totk))
latest {:hyra hyra :tarea tarea :omk omk :barea barea :notes notes :totk totk :totk2 totk2}]
(if (= 1 spara)
(db/addb! latest)
(layout/render params "btable.html" {:latest (assoc params :notes notes :totk totk :totk2 (Math/round (* 100000 totk)))}))))
but when trying to add the values to my database
(db/addb! latest)
I get the above error. I thought Long/parseLong would take care of the conversion? any ideas?