Skip to content

Commit

Permalink
Documentation update
Browse files Browse the repository at this point in the history
  • Loading branch information
leigeber committed May 20, 2014
1 parent 8e9f83a commit 2ac6123
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,22 @@

Math allows you to execute many PHP math functions in your ExpressionEngine templates without needing to enable PHP parsing.

## Quick Tag Reference (full documentation below)

formula="(5 * 2) / [1]" — math formula (required) supports the following operators as well as bitwise + - * / % ++ -- < > <= => != <> ==
params="{var}|{var2}" — pipe delimited list of numeric parameters to be replaced into formula, recommended due to use of PHP eval (default: null)
decimals="2" — sets the number of decimal points (default: "0")
decimal_point="." — sets the separator for the decimal point (default: ".")
thousands_seperator="," — sets the thousands separator; (default: ",")
absolute="yes" — return the absolute number of the result (defaults: "no")
round="up|down|ceil" — whether to round the result up or down (defaults: no rounding)
numeric_error="Error" — message returned when non-numeric parameters are provided (default: "Invalid input")
trailing_zeros="yes" — include trailing 0 decimal places (defaults: "no")

## Parameters

More detailed reference.

### formula="(5 * 2) / [1]"

This is a required parameter and supports the following standard PHP operators as well as bitwise operators:
Expand Down Expand Up @@ -65,6 +79,7 @@ Example:
Output: 5 (where {total_results} is 10)

{exp:math formula="2/3" decimals="2" round="up"}

Output: 0.67

### numeric_error="Error"
Expand Down

0 comments on commit 2ac6123

Please sign in to comment.