Skip to main content

Modifier: :numeric

Strip formatting to a bare number. Write it after a colon: {Price:5:numeric}

About

Removes currency and thousands separators. Compared against the whole modifier string, so it cannot be combined with another modifier.

ProductGravity Forms
RequiresGravity Forms 1.9 or later
Works onNumber, Option, Quantity, Product, Total, Shipping, Calculation, Product price, Product (hidden), Product (single), Shipping (single) fields
In the pickerWhat to show
CombiningOnly works on its own: with any other modifier, it is ignored.

How to use it

Pass an amount to a script

The number without the currency symbol and thousands separator.

Write

<span data-amount="{Amount:8:numeric}">{Amount:8}</span>

Get

<span data-amount="1234.56">$1,234.56</span>

Examples

Rendered by real Gravity Forms and GravityKit PHP against a test entry.

Merge tagOutputWithout the modifier
{Amount:8:numeric}1234.56$1,234.56

Where the merge tag picker offers it

Form fields: Number · Calculation · Product · Product (single) · Product (hidden) · Product price · Quantity · Option · Shipping · Shipping (single) · Total.