fix showing twice word ETH

This commit is contained in:
Roman Volosovskyi 2017-10-20 20:54:54 +02:00
parent 88326d4b56
commit 0ebd4fbd33
2 changed files with 5 additions and 2 deletions

View File

@ -123,7 +123,7 @@
[react/text {:style styles/asset-item-value
:number-of-lines 1
:ellipsize-mode :tail}
(money/wei->str :eth amount)]
(money/to-fixed (money/wei-> :eth amount))]
[react/text {:style styles/asset-item-currency
:uppercase? true
:number-of-lines 1}

View File

@ -66,8 +66,11 @@
(defn wei-> [unit n]
(.dividedBy (bignumber n) (eth-units unit)))
(defn to-fixed [bn]
(.toFixed bn))
(defn wei->str [unit n]
(str (.toFixed (wei-> unit n)) " " (string/upper-case (name unit))))
(str (to-fixed (wei-> unit n)) " " (string/upper-case (name unit))))
(defn wei->ether [n]
(wei-> :eth n))