🎉 Celebrate with 10% OFF on All Products! Use Code: GFEX10 Or Buy Any 2+ Items for 30% OFF with Code: GFEX30!

Gravity Forms Measurement Field (Unit Conversion) Setup Guide

Updated 10 min read Gravity Forms Analytics & Ad Tracking
On this page
  1. Video walkthrough
  2. What you need
  3. Install and activate
  4. Add a Measurement field
  5. Measures
  6. Units visitors can use
  7. Unit shown first
  8. Store the value in
  9. Decimal places
  10. Minimum and maximum
  11. Message when the value is out of range
  12. Show the value in the stored unit
  13. Remember the unit each visitor picks
  14. Filling in the field
  15. How values are converted and checked
  16. Merge tags
  17. Calculations and product prices
  18. Conditional logic
  19. BMI helper
  20. Entries, the entry screen and the export
  21. Privacy and performance
  22. Uninstall
  23. Questions
  24. Can I change the base unit after entries exist?
  25. Why is the stored value slightly different from what was typed?
  26. Can visitors enter a negative value?
  27. What does the visitor see after a failed submission?
  28. What happens if the license expires?

Video walkthrough

Gravity Forms Measurement Field Setup Guide: Unit Conversion for Height, Weight & Length
Video setup guide: Gravity Forms Measurement Field Watch on YouTube

The Gravity Forms Measurement Field (Unit Conversion) add-on adds a Measurement field to Gravity Forms. Visitors enter a height, weight, length, area, volume or temperature in the unit they know — centimetres or feet and inches, kilograms, pounds or stones and pounds, square metres or square feet, litres or gallons, Celsius or Fahrenheit — and every entry stores the value in one base unit that you choose. This guide covers installation, every field setting, how values are converted and checked, merge tags, calculations, conditional logic, the BMI helper, the entry screen and the export.

A bike fitting form with a Height field in feet and inches showing 5 ft 10 in and the line = 177.8 cm, a Weight field in stones and pounds showing 11 st 4 lb with = 71.67 kg and the badge BMI 22.7: Healthy weight, and the read-only BMI and calculated Height in metres fields
Height in feet and inches, weight in stones and pounds: the form shows the stored value and the BMI as the visitor types.

What you need

  • WordPress 6.5 or newer and PHP 7.4 or newer.
  • Gravity Forms 2.9 or newer (tested with 2.9 and 3.1).
  • A GravityExtra license key for this add-on.

Nothing else is needed: no extra library and no outside service. All conversions and checks run on your own server.

Install and activate

  1. In WordPress go to Plugins → Add New → Upload Plugin, choose the add-on zip file and click Install Now, then Activate.
  2. Go to Forms → Settings → Measurement Field, paste your license key and click Activate License.
  3. Open a form in the form editor. The Measurement button is in the Advanced Fields group.

Every feature needs an active license. Without one, the Measurement button is hidden, existing Measurement fields are not shown on your forms (so they are never required), unit merge tags are empty and the “as entered” columns are not listed. Values already stored on entries are kept.

Add a Measurement field

Click Measurement in Advanced Fields. A new field starts as a body height field with centimetres and feet and inches, stored in centimetres with one decimal place. Change the label, then open the field settings. The Measurement settings are in the General tab, under the usual label and description options.

The Measurement field settings: what it measures, the units visitors can use as tick boxes, the unit shown first, the stored unit, decimal places, minimum and maximum with their own units, the out-of-range message, the converted-value and remember-unit options, and the BMI helper with its height field and Number field
The Measurement field settings in the form editor.

Measures

Choose the quantity. Each one has its own list of units:

  • Length and Height (body): millimetres, centimetres, metres, kilometres, inches, feet, feet and inches, yards and miles.
  • Weight: grams, kilograms, tonnes, ounces, pounds, pounds and ounces, stones, and stones and pounds.
  • Area: square centimetres, square metres, hectares, square kilometres, square inches, square feet, square yards, acres and square miles.
  • Volume: millilitres, litres, cubic centimetres, cubic metres, cubic inches, cubic feet, cubic yards, US fluid ounces, cups, pints, quarts and gallons, and UK fluid ounces, pints and gallons.
  • Temperature: degrees Celsius, degrees Fahrenheit and kelvin.

Height and Length use the same units; Height starts with feet and inches and centimetres ticked, which suits sign-up, fitting and medical forms. Changing the quantity resets the units to sensible defaults for that quantity.

Units visitors can use

Tick every unit the visitor may pick. The unit list on the form shows them in the order of the settings. If you tick a single unit, the form shows that unit as text instead of a list. At least one unit always stays ticked.

Unit shown first

The unit selected when the form opens. Pick the unit most of your visitors use; the others are one click away.

Store the value in

The base unit. Whatever unit the visitor picks, the entry stores the value converted into this unit. Calculations, conditional logic, sorting, the entries list and the export all use it, so pick the unit your business works in — centimetres for a fitting service, square metres for a flooring price list, litres for tank sizes. Two-part units such as feet and inches cannot be the base unit, because the stored value is always a single number.

Decimal places

How many decimals the stored value keeps (0 to 6). The value is rounded half away from zero: 177.75 cm with one decimal is stored as 177.8. Unit merge tags and calculation values in another unit keep two more decimals than this setting, so a height stored as 177.8 cm gives 1.778 m and 5.833 ft.

Minimum and maximum

Each limit has its own unit, so you can write the rule the way you think of it: a minimum of 4.5 ft and a maximum of 2.2 m, or a maximum of 1 acre for a lawn quote. The server converts the visitor’s value and the limits into the base unit and compares them, with a tiny tolerance so that a value exactly on the limit in another unit (54 in against a minimum of 4.5 ft) is accepted. The visitor sees the limits in the unit they chose: someone typing in feet and inches reads “Please enter a value from 4 ft 6 in to 7 ft 2.6 in”, someone typing in inches reads “from 54 in to 86.6 in”.

Message when the value is out of range

Leave it empty for the default wording, or write your own. {min} and {max} are replaced with the limits in the visitor’s unit and {value} with what they typed.

Show the value in the stored unit

When ticked (the default), a short line under the field shows the converted value as the visitor types, for example “= 177.8 cm”. It is hidden while the visitor is already using the base unit. The line is announced politely by screen readers.

Remember the unit each visitor picks

When ticked, the unit a visitor picks is saved in their own browser and selected again the next time they open a form with the same quantity. Nothing is stored on your server and no cookie is set.

Filling in the field

The visitor types a number and picks a unit. Feet and inches, stones and pounds, and pounds and ounces show two boxes; the first takes a whole number and the second must be less than one of the big unit (under 12 inches, under 14 pounds, under 16 ounces). A decimal comma is accepted as well as a decimal point, so “72,5” means 72.5. When the visitor changes unit, the value already typed is converted, so 70 inches becomes 177.8 centimetres and then 5 ft 10 in.

The field is a fieldset whose legend is the field label. Each box has its own label (the two-part boxes show “ft” and “in” next to them), the unit list is labelled “Unit”, and the field description and the converted value are linked to the boxes. Tab moves from box to box and then to the unit list. On phones the number keyboard opens, and the boxes and the unit list stack in one column.

The same form on a 390 pixel wide phone screen: the number boxes and the unit list stack in one column and every value fits without sideways scrolling
On a phone the boxes and the unit list stack, with large touch targets.

How values are converted and checked

Every unit is defined from its exact legal value: 1 inch is 2.54 cm, 1 foot 30.48 cm, 1 yard 0.9144 m, 1 mile 1,609.344 m; 1 pound is 0.45359237 kg, 1 ounce a sixteenth of a pound, 1 stone 14 pounds; 1 acre is 4,046.8564224 m²; 1 US gallon is 231 cubic inches (3.785411784 L) and 1 UK gallon 4.54609 L; 0 °C is 273.15 K and Fahrenheit is converted through kelvin. The add-on ships with tests for every one of these definitions and for round trips between every pair of units.

When the form is submitted, the add-on reads only the numbers typed and the unit chosen. It checks that the unit is one you allowed, that each box holds a plain number (no letters, no exponents, no minus sign except for temperature), that the small box of a two-part value is in range and that a temperature is not below absolute zero. It then converts the value into the base unit, checks your minimum and maximum, and stores the result. The browser also works out the value for calculations and conditional logic, with the same factors and the same rounding, but that value is never trusted: a value changed in the browser, or a unit added to the list, is ignored or refused.

Merge tags

Use the field’s merge tag in notifications, confirmations and anywhere Gravity Forms replaces merge tags. The examples use a field labelled Height with ID 3, stored in centimetres:

  • {Height:3} → 177.8 cm (the stored value with its unit)
  • {Height:3:value} → 177.8 (the plain stored number)
  • {Height:3:in}, {Height:3:m}, {Height:3:ft} → 70, 1.778, 5.833 (the number in that unit; any unit of the same quantity works)
  • {Height:3:ft_in} → 5 ft 10 in (two-part units as text: ft_in, st_lb, lb_oz)
  • {Height:3:display} → what the visitor typed, for example 5 ft 10 in
  • {Height:3:unit} → the unit the visitor chose, for example ft + in

Unit keys are lower case: mm, cm, m, km, in, ft, yd, mi, g, kg, t, oz, lb, st, cm2, m2, ha, km2, in2, ft2, yd2, acre, mi2, ml, l, cm3, m3, in3, ft3, yd3, floz_us, cup_us, pt_us, qt_us, gal_us, floz_uk, pt_uk, gal_uk, c, f and k. Gravity Forms already uses the {Label:ID} form for every field, so the add-on reads the part after the second colon instead of adding new tag names.

Calculations and product prices

A Measurement field can be used in a Number field calculation or a calculated product price like any number. {Height:3} gives the stored value; add a unit to get the value in that unit. A flooring quote stored in square metres can use {Floor area:1:m2} * 24.5, a shipping form stored in kilograms can price per pound with {Parcel:2:lb} * 1.2, and a tank quote can show {Water tank:4:gal_us}. The browser updates the result as the visitor types, and Gravity Forms works it out again on the server from the stored value, so the two always agree. The value is written with the decimal separator the calculation expects, so it works with decimal-comma Number fields too.

Conditional logic

Measurement fields appear in conditional logic rules. Rules compare numbers in the base unit, whatever unit the visitor typed in: a rule “Height is greater than 190” on a field stored in centimetres shows a field for a visitor who typed 76 inches (193 cm) and hides it for 5 ft 11 in (180.3 cm). The same comparison runs on the server when the form is submitted.

BMI helper

On a weight field, choose a height field (a Measurement field measuring height or length) and, optionally, a Number field to receive the body mass index. The add-on works out BMI = weight in kilograms / (height in metres)², rounded to one decimal, from the two stored values. With “Show the BMI and its band” ticked, a badge under the weight field shows, for example, “BMI 22.7: Healthy weight”. The bands are the adult bands of the World Health Organization: under 18.5 underweight, 18.5 to under 25 healthy weight, 25 to under 30 overweight, 30 and over obese. The BMI Number field becomes read-only on the form and is always set again on the server. {Weight:4:bmi} and {Weight:4:bmi_band} give the BMI and its band in notifications. The BMI is a screening number for adults and is not medical advice.

Entries, the entry screen and the export

Each entry stores the base value as the field value. The entries list shows it with its unit, for example 177.8 cm. On the entry screen the value is followed by what the visitor typed, such as “(entered as 5 ft 10 in)”, and on a weight field with the BMI helper, by the BMI and its band.

The entry screen: Height 177.8 cm (entered as 5 ft 10 in), Weight 71.67 kg (entered as 11 st 4 lb) with BMI 22.7: Healthy weight, and the calculated fields
The entry keeps the stored value and what the visitor typed.

In Forms → Import/Export → Export Entries, the field exports the plain base number, ready for a spreadsheet. Each Measurement field also adds a column “Label (as entered)” with what the visitor typed; tick it to export it next to the value. The same column can be added to the entries list from the column picker.

Privacy and performance

The add-on makes no outside request beyond the GravityExtra licence and update checks. The only data it adds to an entry is the text the visitor typed and the unit key; the remember-unit option stores the unit key in the visitor’s own browser only. The browser script and stylesheet load only on forms that contain a Measurement field.

Uninstall

Deleting the add-on removes its license and settings options. Stored values and the “as entered” text stay on the entries they belong to.

Questions

Can I change the base unit after entries exist?

The stored numbers are not converted when you change the base unit, so old entries keep their old unit. Pick the base unit before the form goes live, or export the old entries first.

Why is the stored value slightly different from what was typed?

Because it is converted and rounded to the decimal places you set. 5 ft 10 in is exactly 177.8 cm; 5 ft 9 in is 175.26 cm and is stored as 175.3 with one decimal. Raise the decimal places if you need more precision; the text the visitor typed is kept unchanged.

Can visitors enter a negative value?

Only for temperature. Length, weight, area and volume take 0 or more, and a temperature below absolute zero is refused.

What does the visitor see after a failed submission?

The boxes keep what they typed and the unit they chose, and the message under the field says what to change.

What happens if the license expires?

The field is no longer shown on your forms and its features stop, but stored entries are not touched. Renew the license to turn everything back on.

Still need help?

Our support team answers tickets every day, usually within a few hours.

0
0
Your Cart
Your cart is emptyReturn to Shop
🔥 FREQUENTLY BOUGHT TOGETHER
Complete Combo & Save 40%!
ITEM IN YOUR CART
Gravity Forms Klaviyo Add-on
$39.00/yr
+
🎁 RECOMMENDED ADD-ON SAVE 40% OFF
Original Price: $39.00/yr
Bundle Special Price: $23.40/yr