Skip to content

Commit

Permalink
[#21644] fix: display zero for empty balances asset
Browse files Browse the repository at this point in the history
  • Loading branch information
mohsen-ghafouri committed Nov 27, 2024
1 parent 9f50686 commit f202f5a
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/status_im/contexts/wallet/common/utils.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,13 @@
(str $ address))
address))

(defn asset-fiat-formatted-for-ui
[currency-symbol fiat-value]
(cond
(money/equal-to fiat-value 0) (str currency-symbol "0.00")
(money/less-than fiat-value 0.01) (str "<" currency-symbol "0.01")
:else (prettify-balance currency-symbol fiat-value)))

(defn fiat-formatted-for-ui
[currency-symbol fiat-value]
(if (money/less-than fiat-value 0.01)
Expand Down Expand Up @@ -294,8 +301,8 @@
formatted-token-price (prettify-balance currency-symbol price)
percentage-change (prettify-percentage-change change-pct-24h)
crypto-value (get-standard-crypto-format token balance prices-per-token)
fiat-value (fiat-formatted-for-ui currency-symbol
fiat-unformatted-value)]
fiat-value (asset-fiat-formatted-for-ui currency-symbol
fiat-unformatted-value)]
{:token (:symbol token)
:token-name (:name token)
:state :default
Expand Down

0 comments on commit f202f5a

Please sign in to comment.