Croco Birthday 2026 JFB banner image
Hurry! Party Ends in
00:00:00:00
18/05-28/05, 2026

How to Format Numbers and Prices in Calculated Fields

Learn how to configure the Calculated Field settings to set currency format (e.g., symbols, decimal precision, thousand separators) and format patterns for numbers, prices, and dates. Watch the Master Calculated Fields in JetFormBuilder video to learn all about Calculated Fields and available functions.

The Calculated Field uses the numeric data inserted into the VALUE field of the block fields. It can be data inserted via the Text Field, Number Field, Date Field, Select Field, etc., static numbers, or meta field values.

In this case, the Calculated Field neglects units in the number formatting, but provides calculations according to the inserted formula and displays the result according to the option set in the VALUE TYPE drop-down list: “as Number,” “as String,” or “as Date”.

Also, you can apply macros for JetFormBuilder as well as use macros for other plugins (like JetAppointment or JetEngine). Read the Macros Guide to learn everything concerning the macro codes available. 

The data computed by the Calculated Field will be displayed as numbers if the “as Number” option is set in the VALUE TYPE field of the Calculated Field. Then, the following settings are available:

the calculated field settings
  • DECIMAL PLACES NUMBER — a field to specify the number of digits that will be displayed to the right of the decimal point;
  • DECIMALS SEPARATOR — a text field to insert the separator sign after the decimals. By default, it is set to “.”;
  • THOUSANDS SEPARATOR — a text field to insert the separator after the thousands groups. By default, there is no separator set;
  • CALCULATED VALUE PREFIX — a text field for a text that will be shown before the resulting value;
  • CALCULATED VALUE SUFFIX — a text field to specify the text that will be displayed after the calculated value.

Also, if you apply the “as String” VALUE TYPE, the values in the corresponding fields are considered as texts, since this option can concatenate string values. For example, the “as String” VALUE TYPE can be added to concatenate the content completed in the form. In this case, the set VALUE will be taken from the fields to make concatenations and not its CALCULATE value.

If the “as String” VALUE TYPE is changed to “as Number”, the Calculated Field numeric values will be pulled for concatenation, but not for calculations.

Format Prices for WooCommerce Products

To set prices for specific products, the WooCommerce plugin should be installed and activated. In this case, move to the WordPress Dashboard > WooCommerce > Settings page and unroll the General tab. Here, scroll down to the Currency options block and fill in the following fields to configure the currency format:

price formating for woocommerce products
  • Currency — drop-down list to select the needed currency instead of the USD set by default;
  • Currency position — drop-down list to select where the currency sign will be displayed;
  • Thousand separator — a text field to insert the separator after the decimals. By default, there is no separator set;
  • Decimal separator — a text field to insert the separator sign after the decimals. By default, it is set to “,”;
  • Number of decimals — a field to specify the number of digits that will be displayed to the right of the decimal point;

Once configured, save the changes by pressing the “Save changes” button. The data set herein will be displayed in the Products list.

the woocommerce products listed

Also, the prices can be used in calculations provided via the Calculated Field. For example, the products can be displayed via the Product Table block, and then the total price of the order can be computed and displayed via the Calculated Field as it is described in the How to Create a Wholesale Order Form in WordPress tutorial. 

Also, watch the JetProductTables WordPress Plugin Overview. WooCommerce Focused video to learn how to develop horizontal and vertical tables, display product variations, customize layouts, and configure advanced search and filtering settings.

In this case, regardless of the values inserted on the WordPress Dashboard > WooCommerce > Settings page, the Calculated Field will display values inserted in its fields (e.g., the currency signs inserted into the CALCULATED VALUE PREFIX field instead of the Currency field of the WooCommerce settings). Here, no sign was added to the corresponding fields of the Calculated Field, and no currency sign is displayed on the front end.

the calculated field on the front end

Format Prices for Booking

While creating a booking form with the JetBooking plugin or an appointment form with the JetAppointment plugin, you can apply macros to calculate prices via the Calculated Field (e.g., the “%META::_apartment_price%” macro 一 the booking macro that returns the price per 1 day/night). In this case, regardless of the currency set for a specific apartment unit, the Calculated Field will display values inserted in its fields (e.g., the currency signs inserted into the CALCULATED VALUE PREFIX field.

Watch the How to Create a Booking Form in WordPress video to learn how to create a fully functional booking website from scratch, build a custom booking form, whether automatically or manually, and more. 

Format Dates

The Calculated Field can compute Date, Time, and Datetime Fields. To learn how to use macros to perform calculations, comparisons, and dynamic form behaviors based on time intervals, read the Macros in Date, Time, and Datetime Fields tutorial.

To display dates correctly, the “as Date” option should be set in the VALUE TYPE field of the Calculated Field. Here, the DATE FORMAT field is available to insert the needed format of date and/or time display.

setting the date formats in calculated fields

In this field, set the date format to calculate the field value using the following patterns:

  • YYYY — 4-digit year (“2024”);
  • MM — month with leading zero (“01–12”); M — month without leading zero (“1–12”); MMM — abbreviated month name (“Jan–Dec”); MMMM — full month name (“January–December”);
  • DD — day of month with leading zero (“01–31”); D — day of month without leading zero (“1–31”); 
  • HH — hours with leading zero (“00–23”) in 24-hour format; H — hours without leading zero (“0–23”) in 24-hour format; hh — hours with leading zero (“01–12”) in 12-hour format; h — hours without leading zero (“1–12”) in 12-hour format;
  • mm — minutes with leading zero (“00–59”); m — minutes without leading zero (“0–59”);
  • ss — seconds with leading zero (“00–59”); s — seconds without leading zero (“0–59”);
  • dddd — full day of week name (“Monday–Sunday”); ddd — abbreviated day of week name (“Mon–Sun”);
  • A — AM/PM designation.

Also, if the calculated result is used for a dynamic value for another date, date-time, or time field, you must use the following formats:

  • YYYY-MM-DD (date field);
  • YYYY-MM-DD HH:mm (date-time field);
  • HH:mm ( time field).

FAQ

Is it possible to calculate data of the same format but specified in different units?

Yes. You can provide all arithmetical operations or apply specific macros .

Is it possible to use macros for dates?

Yes, read the How to Use Macros in Date, Time, and Datetime Fields tutorial for more details.

Is it possible to apply conditional logic to numeric and/or date/time fields?

Yes, read the Conditinal Visibility for Form Fields via Conditional Block tutorial for more details. In addition, to apply conditions to basic mathematical operations like addition, subtraction, multiplication, and division, as well as use ternary operation(s) and their combinations, read the
How to Use Conditional Formulas in the Calculated Field tutorial.

Is it possible to calculate a numeric value returned by any of the JetFormBuilder fields?

The Calculated field of JetFormBuilder is not limited to basic mathematical operations like addition, subtraction, multiplication, and division. It supports all the Math object methods, which helps perform advanced calculations with numeric values returned by form fields, as the Advanced Math Calculations tutorial explains.

That’s it. Now you know how to configure the Calculated Field settings to set currency symbols, decimal precision, thousand separators, and format patterns for numbers, prices, and dates using the JetFormBuilder plugin for WordPress.