Skip to content

Instantly share code, notes, and snippets.

@bitemyapp
Created October 26, 2013 08:22
Show Gist options
  • Select an option

  • Save bitemyapp/7166725 to your computer and use it in GitHub Desktop.

Select an option

Save bitemyapp/7166725 to your computer and use it in GitHub Desktop.
;; fuck yo JavaScript Numbers son
(defn ends-in-0 [n]
(contains? #{0.0 0} (mod n 1)))
(defn maybe-int [n]
(or (and (ends-in-0 n) (int n)) n))
(defmethod response
:r-num
[m]
(maybe-int (:r-num m)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment