mirror of
https://github.com/penpot/penpot.git
synced 2025-05-18 07:46:11 +02:00
Improve parse-int function.
This commit is contained in:
parent
6e36718702
commit
48819a1738
1 changed files with 2 additions and 2 deletions
|
@ -94,7 +94,7 @@
|
||||||
|
|
||||||
(defn parse-int
|
(defn parse-int
|
||||||
([v]
|
([v]
|
||||||
(js/parseInt v 10))
|
(parse-int v nil))
|
||||||
([v default]
|
([v default]
|
||||||
(let [v (js/parseInt v 10)]
|
(let [v (js/parseInt v 10)]
|
||||||
(if (or (not v) (nan? v))
|
(if (or (not v) (nan? v))
|
||||||
|
@ -103,7 +103,7 @@
|
||||||
|
|
||||||
(defn parse-float
|
(defn parse-float
|
||||||
([v]
|
([v]
|
||||||
(js/parseFloat v))
|
(parse-float v nil))
|
||||||
([v default]
|
([v default]
|
||||||
(let [v (js/parseFloat v)]
|
(let [v (js/parseFloat v)]
|
||||||
(if (or (not v) (nan? v))
|
(if (or (not v) (nan? v))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue