**Arithmetic in **WordPress is now easy.

Math by GravityView makes performing calculations simple. Gravity Forms and GravityView are not required.

**Do math with your Gravity Forms form data.** Calculate totals. Perform complex functions. Count the number of entries in a form Values are always up to date.

## “Pure” Math

Do mathematical calculations. Gravity Forms and GravityView **not required**.

**Simple arithmetic** in WordPress is now easy:

`[gv_math]129 * 293[/gv_math]`

**Advanced calculations** are possible, too. Want to calculate the area of a circle? Here’s how to do πr^{2} with a radius of 4.5:

`[gv_math] PI * pow( 4.5, 2 ) [/gv_math]`

## Gravity Forms

Perform calculations based on all entries in a Gravity Forms form. Note: Gravity Forms collects tons (or *tonnes* 🇬🇧 ) of diverse data, so your use may not match our examples.

### Perform form-wide calculations:

- Show the sum of field values
- Display the number of entries in a form
- Get the average of field values
- Reveal the highest field value
- Show the lowest field value

### Works great with GravityView:

Perform calculations for all visible entries, and on a single entry page.

- Calculate values for the now visible entries (great for showing a total or average value)
- Perform advanced calculations between multiple fields
- Works great in a Custom Content field or widget

## Support Documents

Math by GravityView support docs.

## Examples

### Gravity Forms

**How many people have RSVP’d to the event?**

`[gv_math scope="form" id="9"]{Your Guests:12}[/gv_math]`

**What is the average age of the respondent?**

`[gv_math scope="form" id="9"]{Your Age:13:avg}[/gv_math]`

**How much money have we raised for the charity ball?**

`[gv_math scope="form" id="9"]{Your Contribution:14}[/gv_math]`

**What is the largest donation we received?**

`[gv_math scope="form" id="9"]{Your Contribution:14:max}[/gv_math]`

### GravityView

**Get the total number of miles now displayed on-screen:**

`[gv_math scope="visible"]{Number of Miles:3}[/gv_math]`

**Get the average number of miles now displayed on-screen:**

`[gv_math scope="visible"]{Number of Miles:3:avg}[/gv_math]`

**Calculate reimbursements for each entry:**

`[gv_math scope="entry"]{Number of Miles:3} * {Rate Per Mile:4}[/gv_math]`

Math by GravityView is powered by Hoa Math, an open-source library.