Show 2 decimals for tokens on comment image
This commit is contained in:
parent
a091d04bb2
commit
92b51251c0
|
@ -26,9 +26,10 @@
|
|||
|
||||
|
||||
(defn token-map->list [tokens]
|
||||
(let [fmt-balance (fn [x] (format "%.02f" (double x)))]
|
||||
(mapv (fn [[tla balance]] {:tla (subs (str tla) 1)
|
||||
:balance balance})
|
||||
tokens))
|
||||
:balance (fmt-balance balance)})
|
||||
tokens)))
|
||||
|
||||
(defn image-height [tokens]
|
||||
(+ 300 (* 32 (count (keys tokens)))))
|
||||
|
@ -73,4 +74,4 @@
|
|||
|
||||
(comment
|
||||
(with-open [w (io/output-stream "foo.png")]
|
||||
(.write w (gen-comment-image "0xf00barbeeff00barbeeff00barbeeff00barbeef" "12.2" {:SNT 250 :GNO 100 :WTF 3452.42} "http://github.com/someorg/somerepo/issues/42"))))
|
||||
(.write w (gen-comment-image "0xf00barbeeff00barbeeff00barbeeff00barbeef" "12.2" {:SNT 250.2000000343 :GNO 100 :WTF 3452.42} "http://github.com/someorg/somerepo/issues/42"))))
|
||||
|
|
Loading…
Reference in New Issue