bolstad/textcalculate

Evaluate string based calculations

1 2017-04-23 18:50 UTC

This package is not auto-updated.

Last update: 2024-04-30 02:03:36 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