title: How to convert jsonAST.Jint to int
body: <p>I am attempting to learn Scala, and I'm trying to parse a JSON file. I have two lines of code:</p>
  
  <pre><code>var jVal:JValue = parse(json);
  val totalCount:Int = (jVal \\ "totalCount").asInstanceOf[Int];
  </code></pre>
  
  <p>However, <code>(jVal \\ "totalCount")</code> returns a <code>JInt</code> instead of an int. If I print it as a string, it looks like <code>"JInt(38)"</code>.</p>
  
  <p>How on earth do I convert this to a regular int? My current code throws an exception saying that</p>
  
  <blockquote>
    <p><code>net.liftweb.json.JsonAST$JInt</code> cannot be cast to <code>java.lang.Integer</code></p>
  </blockquote>
  
  <p>I've scoured the internet, but I can't find any answers. I would really prefer not to manually parse and remove the "JInt()" part of the string just to get it as an integer.</p>
  
  <p>Surely I am missing a simple way to do this?</p>