bolstad / textcalculate
Evaluate string based calculations
Installs: 2 233
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 1
Requires (Dev)
- phpunit/phpunit: 4.0.*
This package is not auto-updated.
Last update: 2024-12-24 04:46:52 UTC
README
Perform calculation on strings and replace placeholders according as configured in an array.
Example:
Given that ITEMS_SOLD = 10 & TAX_RATE = 0.25 AND PROCESS_FEE = 3,
calculate() can solve and return the result for '((ITEMS_SOLD * 15) + PROCESS_FEE) * 0.25'
Please see tests/PlaceholderCalcTest.php
for example code