Add-on: Advanced Number Field
Advanced Number Field is a Gravity Forms add-on that extends the Number field. It rounds values to 0–6 decimals, forces absolute numbers, shows a fixed number of decimals, adds a custom unit like % or m², formats numbers in crore notation, calculates the allowed minimum and maximum from other fields, adds Min(), Max() and Pow() to calculation formulas and turns the field into a styled range slider. Use it for order forms, calculators and quotes where number input must be valid and easy to read.
All options are also available for the Quantity product field.
Where to find the settings
- Open your form in the form editor and select a Number field (or a Quantity field).
- In the General tab of the field settings you find two groups:
- Advanced Number Settings: Crore notation, Round the Value (with Rounding to decimal places, Rounding method and Fixed point notation), Force Absolute and Add Custom Unit.
- Advanced Range Settings: Enable Minimum Value Calculation, Enable Maximum Value Calculation and Show as Slider.
- The look of sliders is set per form in Form Settings → Advanced Number.
Features and documentation
| Feature | What it does |
|---|---|
| Rounding | Round the Value rounds typed and calculated values to 0–6 decimals (0 or 2 for Currency) with Round, Ceil or Floor. |
| Fixed Point Notation | Always shows the rounding decimals, so with 5 decimals 2.5 becomes 2.50000. |
| Force Absolute | Turns negative numbers into positive numbers (-5 becomes 5), before rounding. |
| Custom Units | Places a unit such as %, m², ft² or gram before or after the input. |
| Crore notation | Groups large numbers as in India and nearby countries: 1,00,00,000. |
| Calculated min / max range | Calculates the allowed minimum and maximum from other fields with a formula. |
| Min(), Max() and Pow() in formulas | Lowest or highest value of a list of fields, and a value raised to a power, in Number field calculations. |
| Range Slider Settings | Show as Slider with a range step, a ruler and live updates of calculations. |
| Styling the Range Slider | Track and thumb colors, sizes, borders and shadows per form. |
| Formatted values in entries, merge tags, GravityView and Gravity PDF | Where the formatting is shown after submission, and how merge tag modifiers return the plain value. |
| Developer filters | gravitywp_anf_show_thousands_sep, gravitywp_anf_decimal_dot_number_input and the gravityWP.advancedNumberField.sliderOutput JavaScript filter. |
In which order the settings are applied
When a value is entered or calculated, Advanced Number Field applies the settings in this order:
- Force Absolute removes the minus sign.
- Round the Value rounds to the chosen number of decimals.
- The number is formatted: Fixed point notation, Crore notation and the thousands separator of the number format.
- The Custom Unit is added before or after the number.
Force Absolute and rounding change the value that is saved in the entry and used in calculations. Fixed point notation, crore notation and the custom unit only change how the value is displayed; the entry stores the plain number.
Limits
- With the Currency number format you can only round to 0 or 2 decimals, and Add Custom Unit is not available.
- Fixed point notation is only available when Round the Value is checked with 1 or more decimal places.
- Show as Slider cannot be combined with a field calculation: checking Enable Calculation unchecks Show as Slider.
- Calculations inside
Min(),Max()orPow(), and nested functions, are not supported.
Requirements
- Gravity Forms 2.5 or later
- WordPress 5.0 or later
- PHP 7.0 or later
- Optional: GravityView 2.0 or later and Gravity PDF, to show the formatted values in views and PDFs
Frequently Asked Questions
You can round to 0, 1, 2, 3, 4, 5 or 6 decimal places. With the Currency number format only 0 or 2 decimal places are available.
Yes. All Advanced Number Field options are also available for the Quantity product field, and a quantity slider updates the product total while sliding.
Add the :numeric modifier to the field merge tag, for example {Area:1:numeric}. A merge tag with a modifier returns the Gravity Forms value without the Advanced Number Field formatting.
No. Everything is set in the field settings and the form settings. Developers can change the slider output and the thousands separator with filters.
Calculated min / max range
Enable Valid Range Calculation, calculating the minimum and maximum value dependent on other values in your Gravity Form using Merge Tags.
Crore notation
Crore notation groups large numbers in a Gravity Forms Number field the way they are written in India and nearby countries, like 1,00,00,000.
Custom Units
Show custom units like % or m2 behind a Number Field value.
Developer Filters
PHP and JavaScript filters of Advanced Number Field: gravitywp_anf_show_thousands_sep, gravitywp_anf_decimal_dot_number_input and gravityWP.advancedNumberField.sliderOutput.
Fixed Point Notation
Enabling Fixed Point Notation will force a number to always have the specified number of decimals, even if it's zero.
Force Absolute
Force Absolute turns negative numbers in a Gravity Forms Number field into positive numbers, before rounding.
Formatted Values in Entries, Merge Tags, GravityView and Gravity PDF
Where Advanced Number Field shows the formatted Number field value after submission, and how merge tag modifiers like :numeric return the plain number.
Min(), Max() and Pow() in Formulas
Min() and Max() formula, calculate the minimum or maximum value from a range of fields using Merge Tags, and Pow() to raise a value to a power.
Range Slider Settings
Turn a Number Field into a (range) Slider.
Rounding
How to round numbers, decide on number of decimal places (0–6) and rounding method (round, ceil, floor)
Styling the Range Slider
Style your sliders in the form settings.