fix: very small token values are being displayed in scientific format (#19349)
This commit is contained in:
parent
418053b21e
commit
32a4bb1153
|
@ -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
|
||||
|
@ -307,11 +307,12 @@
|
|||
token-images
|
||||
{:keys [satisfied criteria]}]
|
||||
(let [sym (:symbol criteria)
|
||||
amount (:amount criteria)]
|
||||
amount-in-wei (: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 amount-in-wei decimals))
|
||||
:img-src (get token-images sym)}))
|
||||
|
||||
(re-frame/reg-sub
|
||||
|
|
|
@ -289,17 +289,21 @@
|
|||
checks {:checking? checking-permissions?
|
||||
:check
|
||||
{:satisfied true
|
||||
:highestRole {:type constants/community-token-permission-become-admin
|
||||
:highestRole
|
||||
{:type constants/community-token-permission-become-admin
|
||||
:criteria [{:tokenRequirement [{:satisfied true
|
||||
:criteria {:contract_addresses
|
||||
{:5 "0x0"}
|
||||
:type 1
|
||||
:symbol "DAI"
|
||||
:amountInWei
|
||||
"5000000000000000000"
|
||||
:amount "5.0"
|
||||
:decimals 18}}]}
|
||||
{:tokenRequirement [{:satisfied false
|
||||
:criteria {:type 1
|
||||
:symbol "ETH"
|
||||
:amountInWei "2000000000000000"
|
||||
:amount "0.002"
|
||||
:decimals 18}}]}]}
|
||||
|
||||
|
|
Loading…
Reference in New Issue