     (compare (Math/abs n2) (Math/abs n1))
     (compare n1 n2)))
     
-(defn display-amount [amount unit neg]
-  (str (if unit (str (subs (str unit) 1) " ") "$") 
-       (fixpt->str (if neg (- amount) amount))))
+(defn display-amount
+  ([amount] (display-amount amount nil nil))
+  ([amount unit] (display-amount amount unit nil))
+  ([amount unit neg]
+   (str (if unit (str (subs (str unit) 1) " ") "$") 
+        (fixpt->str (if neg (- amount) amount)))))
 
 (defn tx-tds [tx]
   (let [[from-part to-part :as parts] (sort-by :amount cmp-sign-abs (:parts tx))]


(defn render-summary [summary-rows]
  (dom/table nil
    (render-table-headings ["Account" "Amount"])
    (apply dom/tbody nil
      (for [{:keys [account amount]} summary-rows]
        (dom/tr nil
          (dom/td nil account)
          (dom/td #js {:style #js {:textAlign "right"}} amount))))))

(defn render-detail [state]
  (dom/div nil

  [["2015/02/23" "Whole Foods" :e-groceries 25 :l-amex]
   ["2015/02/24" "Trader Joe's" :e-groceries 20 :e-alcohol 10 :l-amex]
   ["2015/02/25" "Ameritrade" :a-ameritrade [100 :GLD] :a-ameritrade -10010]]

  [{:date "2015/02/20", :SLV 15, :GLD 100 }
   {:date "2015/02/21", :SLV 15.20, :GLD 103 }]

)   
    
