BlogIntegrations · October 30, 2026 · 5 min read

Contact Form 7 Decimal Amounts: Preserve Budgets Through Lead Integrations

Preserve decimal amounts from CF7 through lead adapters. Define locale, precision, rounding, missing values and destination serialization before mapping.

A budget entered as 1250.50 can become a different value if a lead adapter guesses its locale, converts it through binary floating point, or sends a formatted display string to a numeric API field. Contact Form 7’s number control is only the beginning of that journey. The receiving record needs a clear amount contract.

Mint beads pass from a form card through a measuring gate into a divided green tray.
Generated conceptual illustration; not a product screenshot or measured result.

This guide focuses on preserving decimal meaning after collection. For the form editor’s minimum, maximum and step options, start with our number-field guide. The examples below describe a proposed custom integration, not an included CF7 feature or a live test of your site.

Define the amount before choosing its representation

Ask the receiving team what the field represents: an approximate project budget, an hourly estimate, a physical measurement or an agreed quotation. A budget is not revenue. A requested number of hours is not money. Keep the unit or currency alongside the value so that a later export does not leave an unexplained number.

Write a small contract that names the accepted decimal separator, permitted range, maximum fractional places, handling of blank answers and destination format. If the form serves several currencies, use a separate explicit currency choice. Do not infer currency from the visitor’s browser language or the location of a sales office.

Separate entry, transport and display

CF7 documents number-field constraints such as step and bounds. Those constraints help define permissible input; they do not specify every connector’s storage and serialization behavior. Inspect the actual accepted value in an approved staging workflow before deciding what your adapter receives.

A practical internal contract might use a decimal string such as "1250.50" and a separate currency code. The exact JSON type must match the destination API. A receiver expecting a number may reject a string; a receiver supporting decimal strings may preserve precision that another system would lose. Document the chosen type instead of assuming that JSON makes all numeric representations equivalent.

Illustrative adapter record, not a CF7 export format:
amount_decimal: "1250.50"
currency: "EUR"
amount_state: "provided"
representation_version: "budget-v1"

Keep a formatted display copy separate. For example, a localized interface might display grouping and a comma decimal separator while the machine contract retains a period. Intl.NumberFormat formats values for presentation; it is not a general parser for arbitrary localized money strings.

Reject ambiguity instead of guessing

The text 1,250 is ambiguous across conventions. Removing punctuation indiscriminately can turn a decimal fraction into a whole-number amount. Replacing every comma with a period can also create invalid output when a string contains grouping separators. Accept only the format your interface promises, or implement a deliberate locale-aware input policy with clear correction feedback.

JavaScript’s parseFloat reference explains that it can accept a valid numeric prefix and ignore later invalid characters. That makes it a poor whole-field validator. A result that looks numeric does not establish that the complete submitted answer was understood.

Preserve the reviewed source value in the appropriate lead record when the workflow needs an audit trail. Avoid copying full payloads into routine logs. A diagnostic can identify the field, representation version and rejection reason without recording a visitor’s entire message or contact details.

Choose precision and rounding deliberately

Decimal arithmetic and binary floating point have different representations. The Python decimal documentation describes exact decimal representation and explicit rounding controls. Equivalent choices exist in other runtimes, but adding a library does not choose your business rule.

Decide whether an excess fractional digit should cause rejection, be retained internally or be rounded at a named boundary. Record the rounding mode. Do not silently round the visitor’s request during every intermediate mapping step. Repeated formatting and reparsing can make the final record depend on which path the inquiry followed.

An integer minor-unit format is another possible destination contract, but it requires an explicit scale. Do not assume every currency or measurement uses two fractional places. If your adapter chooses that format, define the scale and conversion once, and ensure the destination field can hold the resulting range.

Keep missing, zero and rejected amounts distinct

A blank optional budget means no amount was supplied. Zero may be a valid answer or a business-rule rejection. A malformed value needs correction. Converting all three to zero destroys the distinction and can overwrite a useful CRM value.

Apply the same care to updates. If a repeat inquiry omits its budget, decide whether that leaves the existing record untouched. Our missing and empty CRM values guide explains why omission, an empty field and an explicit clear operation need separate rules.

Verify the complete round trip

Use synthetic fixtures for a whole amount, a trailing-zero decimal, the smallest accepted fraction, the maximum, a value just outside the range, excess precision, a blank, zero and ambiguous punctuation. State the expected result before running the adapter. Inspect the destination record and its later export as well as the outgoing request.

Include a record update and a read-back from the API. A correct outbound string is insufficient if the CRM stores it in a text field that cannot support the intended filters. Conversely, a visually shortened display does not necessarily prove that stored precision disappeared. Verify the actual field contract.

For a maintained custom adapter, compare our five decimal arithmetic libraries. We publish CF7 Analytics and develop the free Svetlik Analytics for Contact Form 7. Its documented submission statistics do not calculate or verify arbitrary budget fields. Keep amount validation in the integration that owns those records.

Sources

Official CF7, MDN and Python references linked above were reviewed October 30, 2026. The record format and review procedure are editorial implementation examples, not a claim of native integration or measured financial results.