mirror of
https://github.com/status-im/open-bounty.git
synced 2025-02-26 16:10:50 +00:00
Catch exceptions during token value formatting
This commit is contained in:
parent
fdabe1e3a7
commit
5888d70801
@ -146,7 +146,11 @@
|
|||||||
|
|
||||||
|
|
||||||
(defn prettify-bounty-items [bounty-items]
|
(defn prettify-bounty-items [bounty-items]
|
||||||
(let [renames {:user_name :display-name
|
(let [format-float (fn [balance]
|
||||||
|
(try
|
||||||
|
(format "%.2f" balance)
|
||||||
|
(catch java.util.IllegalFormatConversionException ex "0.00")))
|
||||||
|
renames {:user_name :display-name
|
||||||
:user_avatar_url :avatar-url
|
:user_avatar_url :avatar-url
|
||||||
:issue_title :issue-title
|
:issue_title :issue-title
|
||||||
:type :item-type
|
:type :item-type
|
||||||
@ -164,7 +168,7 @@
|
|||||||
(update :tokens (fn [tokens]
|
(update :tokens (fn [tokens]
|
||||||
(into {}
|
(into {}
|
||||||
(map (fn [[tla balance]]
|
(map (fn [[tla balance]]
|
||||||
[tla (format "%.2f" balance)])
|
[tla (format-float balance)])
|
||||||
tokens)))))
|
tokens)))))
|
||||||
bounty-items)))
|
bounty-items)))
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user