Commit bbe86780 authored by Johannes Knödtel's avatar Johannes Knödtel 🎶
Browse files

when a product is not bought or requested assume a number of 0

parent a4e360e2
......@@ -64,7 +64,8 @@
(group-by (juxt :food_name :comment) numbers)))
(defn add-difference [summed-numbers]
(map #(assoc % :difference (- (:total_ammount %) (:number %))) summed-numbers))
(map #(assoc % :difference (- (or (:total_ammount %) 0.0M)
(or (:number %) 0.0M))) summed-numbers))
(defn user-agent-curl? [headers]
(.startsWith (get headers "user-agent" "") "curl"))
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment