public function calculate($expression)
    {
        $translatedExpression = $this->translate($expression);
        $result = eval('return '.$translatedExpression.';');

        $decimalResult = new Number($result); // this is bad and needs some work

        return $decimalResult->convert($this->numberSystem);
    }
public function calculate($expression)
    {
        $translatedExpression = $this->translate($expression);
        $result = eval('return '.$translatedExpression.';');

        $decimalResult = new Number($result); // this is bad and needs some work

        return $decimalResult->convert($this->numberSystem);
    }
public function calculate ( $ expression ) { $ translatedExpression = $ this -> translate ( $ expression ) ; $ result = eval ( 'return ' . $ translatedExpression . ';' ) ; $ decimalResult = new Number ( $ result ) ; // this is bad and needs some work return $ decimalResult -> convert ( $ this -> numberSystem ) ; }
Calculate a mathematical expression that uses pokemath-numbers

@param $expression

@return Number
Calculate a mathematical expression that uses pokemath - numbers