Skip to content

hlap/expressionCalculatorBundle

Repository files navigation

Symfony Calculator Bundle for arithmetic expressions

Basic usage

Typehint argument with CalculatorService if autowiring is enabled or pass it as argument of your service in configuration file.

use Alapin\CalculatorBundle\Service\CalculatorService;

public function showResult(CalculatorService $calculatorService)
{
    $expression = '(2.16 - 48.34)*2.7';
    $result = $calculatorService->calculate($expression, 'default')
    
    return $result;
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages