mirror of
https://github.com/status-im/open-bounty.git
synced 2025-02-26 08:05:28 +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]
|
||||
(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
|
||||
:issue_title :issue-title
|
||||
:type :item-type
|
||||
@ -164,7 +168,7 @@
|
||||
(update :tokens (fn [tokens]
|
||||
(into {}
|
||||
(map (fn [[tla balance]]
|
||||
[tla (format "%.2f" balance)])
|
||||
[tla (format-float balance)])
|
||||
tokens)))))
|
||||
bounty-items)))
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user