Skip to content

Commit

Permalink
replace js/parseFloat with money/bignumber
Browse files Browse the repository at this point in the history
  • Loading branch information
mmilad75 committed Apr 18, 2024
1 parent 409f28e commit 2f5c3f1
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/status_im/contexts/wallet/send/input_amount/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
[utils.address :as address]
[utils.debounce :as debounce]
[utils.i18n :as i18n]
[utils.money :as money]
[utils.re-frame :as rf]))

(defn- make-limit-label
Expand Down Expand Up @@ -85,8 +86,11 @@

(defn- reset-input-error
[new-value prev-value input-error]
(reset! input-error
(> (js/parseFloat new-value) (js/parseFloat prev-value))))
(let [converted-new-value (money/bignumber new-value)
converted-prev-value (money/bignumber prev-value)]
(when (and converted-new-value converted-prev-value)
(reset! input-error
(money/greater-than converted-new-value converted-prev-value)))))

(defn delete-from-string
[s idx]
Expand Down

0 comments on commit 2f5c3f1

Please sign in to comment.