Skip to content

Commit

Permalink
fix: very small token values are being displayed in scientific format
Browse files Browse the repository at this point in the history
  • Loading branch information
ajayesivan committed Mar 21, 2024
1 parent fd24a80 commit 8ffdd6a
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/status_im/subs/communities.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
[legacy.status-im.ui.screens.profile.visibility-status.utils :as visibility-status-utils]
[re-frame.core :as re-frame]
[status-im.constants :as constants]
[status-im.contexts.wallet.common.utils :as wallet.utils]
[utils.i18n :as i18n]))
[utils.i18n :as i18n]
[utils.money :as money]))

(re-frame/reg-sub
:communities/fetching-community
Expand Down Expand Up @@ -266,8 +266,8 @@
:position position
:mentions-count (or unviewed-mentions-count 0)
:can-post? can-post?
;; NOTE: this is a troolean nil->no permissions, true->no access, false ->
;; has access
;; NOTE: this is a troolean nil->no permissions, true->no access, false
;; -> has access
:locked? (when token-gated?
(and (not can-view?)
(not can-post?)))
Expand Down Expand Up @@ -306,12 +306,13 @@
[checking-permissions?
token-images
{:keys [satisfied criteria]}]
(let [sym (:symbol criteria)
amount (:amount criteria)]
(let [sym (:symbol criteria)
amountInWei (:amountInWei criteria)
decimals (:decimals criteria)]
{:symbol sym
:sufficient? satisfied
:loading? checking-permissions?
:amount (wallet.utils/remove-trailing-zeroes amount)
:amount (money/to-fixed (money/token->unit amountInWei decimals))
:img-src (get token-images sym)}))

(re-frame/reg-sub
Expand Down

0 comments on commit 8ffdd6a

Please sign in to comment.