Format a listing price
Use a Number field for a price that must be validated, sorted, or filtered. Store only the numeric amount and add the currency or unit where the value is displayed.
Create the Number field
Section titled “Create the Number field”Edit the listing type and open Fields. Add a Number field, give it a stable Key such as price, and set Minimum value, Maximum value, and Step size when the listing form needs those constraints. The default step is 1.
Listing owners should enter a plain number such as 5000 or 4999.95. Do not store $, €, commas, or text such as per month in the Number field. MyListing validates the submitted value with PHP’s numeric rules; presentation is added later.
If the listings come from WP All Import, map the source into the Number field in MyListing Add-On and normalize the source to the same plain numeric convention. See Import listings.
Format a cover detail
Section titled “Format a cover detail”- Edit the listing type and open Single Page → Cover Details.
- Select the Price preset or Add Custom Detail.
- Open the new detail and choose the Number field under Field.
- Set Format to Number.
- Set Decimals explicitly. The default is effectively zero when no value has been saved.
- Add a currency under Prefix or a unit under Suffix, such as
$,€, or/ month.
The cover formatter uses WordPress locale separators and the selected decimal count. Cover details and cover actions share a default limit of three items, so adding a price can displace another item when that limit is already reached.
Format dynamic text
Section titled “Format dynamic text”Inputs with MyListing’s @ field picker—including Preview Card text and rows in Table, Details, Accordion, or Tabs blocks—offer the Number field’s Formatted variant. For a field whose key is price, the saved bracket syntax is:
$[[price.format]]The modifier key is .format; the .formatted spelling in the legacy guide is not implemented by the current Number field.
Use the price shortcode
Section titled “Use the price shortcode”In a MyListing Shortcode block, the built-in formatter can add the theme’s price markup:
[27-format type="price" prefix="$" postfix=" / month"][[price]][/27-format]Replace price with the field’s key. The shortcode outputs nothing for an empty or non-numeric value. Like .format, it calls number_format_i18n() without a decimal-count argument, so it is intended for whole-number prices. include-markup="no" strips the wrapper tags when plain text is needed, but it does not change the rounding.
Neither MyListing formatter uses WooCommerce’s currency settings, currency position, decimal setting, or currency conversion. Prefixes and suffixes are literal display text.
Format a search range
Section titled “Format a search range”- Edit the listing type and open Search Forms → Advanced Form or Basic Form.
- Add or edit a Range filter and select the Number field under Source.
- Choose Range slider or Single slider and, for a single slider, select its greater-than or less-than behavior.
- Set Step size, Prefix, and Suffix.
- Turn on Format the numeric value for display (e.g. 12500 becomes 12,500).
The checkbox changes only the number shown beside the slider. It does not change the stored amount or convert currencies. Keep all values in one currency and unit if they share a range filter.
The non-indexed range query casts values to DECIMAL(11,2), covering -999999999.99 through 999999999.99. A site that must query larger numbers or more than two decimal places needs a hard-coded mylisting/range-filter:typecast override maintained in a child theme or site plugin; display formatting alone does not widen that fallback query type. The optional Search Index uses dedicated decimal columns instead. After changing an indexed Range source, open Search Forms → Search Index and reindex if the screen reports that it is required.
When Preview Card caching is enabled, listing saves refresh that listing’s card. After changing the Preview Card template itself, regenerate the affected type under Theme Tools → Performance → Preview Cards → Caching.
Next: Format a listing date →
