code: public double getDouble( String key ) {
        verifyIsNull();
        Object o = get( key );
        if( o != null ){
           try{
              return o instanceof Number ? ((Number) o).doubleValue()
                    : Double.parseDouble( (String) o );
           }catch( Exception e ){
              throw new JSONException( "JSONObject[" + JSONUtils.quote( key ) + "] is not a number." );
           }
        }
        throw new JSONException( "JSONObject[" + JSONUtils.quote( key ) + "] is not a number." );
     }
docs: Get the double value associated with a key.
  
  @param key A key string.
  @return The numeric value.
  @throws JSONException if the key is not found or if the value is not a
  Number object and cannot be converted to a number.