Piwik\Plugin\Controller::getNumericValue PHP Method

getNumericValue() protected method

Works only for API methods that originally returns numeric values (there is no cast here)
protected getNumericValue ( string $methodToCall, boolean | string $date = false ) : integer | float
$methodToCall string Name of method to call, eg. Referrers.getNumberOfDistinctSearchEngines
$date boolean | string A custom date to use when getting the value. If false, the 'date' query parameter is used.
return integer | float
    protected function getNumericValue($methodToCall, $date = false)
    {
        $params = $date === false ? array() : array('date' => $date);
        $return = Request::processRequest($methodToCall, $params);
        $columns = $return->getFirstRow()->getColumns();
        return reset($columns);
    }