title: Clojure casting string to double from user input
body: <p>Over at <a href="https://clojuredocs.org/clojure.core/read" rel="nofollow">clojuredocs.com</a> they discussed why to not use <code>read</code> or <code>read-string</code> from untrusted sources. One way to use it might be as such:</p>
  
  <pre><code>=&gt; (double (read-string "1.99"))
  =&gt; 1.99
  =&gt; (.Double "1.22")
  =&gt; IllegalArgumentException No matching field found: Double for class...
  </code></pre>
  
  <p>Which is useful if you need a double to store in the database. But what if the data is from user input? Suppose users want to enter their height in feet or something. How could we take the input string from a webpage and convert it to a double or other numeric value safely?</p>