WP Residence Help WP Residence Help

  • WPRESIDENCE
  • Video Tutorials
  • Client Support
  • API
Home / Technical how to | Custom Code / How change price number format

How change price number format

4401 views 0

How to Change the Price Number Format

Theme versions 3.9.1 and higher

  1. Open the parent theme file wpresidence/libs/help_functions.php.
  2. Locate the function wpestate_format_number_price (around line 1179 in WPResidence version 5.3.2.1).
  3. Inside that function adjust the number_format call so that the decimals argument is set to 2. This forces prices to always show two decimal places even when the value ends in 00.
  4. If you are working in a child theme, copy the entire wpestate_format_number_price function to the child theme first because the original function is wrapped in if (! function_exists('wpestate_format_number_price')). Updating it in the child theme keeps the customization through future parent theme updates.

Guidance for older theme versions

The same price formatting logic lives in wp-content/themes/wpresidence/libs/help_functions.php. Adjust the number_format call in the wpestate_format_number_price function to match your desired number of decimals, thousands separator, and decimal separator. Refer to the PHP manual for number_format for parameter details.

Example: Indian numbering format

  1. Edit wp-content/themes/wpresidence/libs/help_functions.php and find the line where $price is constructed (the same wpestate_format_number_price function, near line 1179 in version 5.3.2.1).
  2. Replace the existing formatting block with the following locale-specific logic:
setlocale(LC_MONETARY, 'en_IN'); $price = money_format('%.0n', $price); 

This change prints prices using the Indian grouping style.

–

2. wp-content/plugins/wpresidence-core

 

Technical how to | Custom Code

Related Articles

  • How to Add Custom Fields to the Login, Register and Forgot Password Forms
  • Technical: Change the Schedule Tour Email Text and the Form Default Message
  • Property list filter customization
  • Technical – How to Change the Minimum Image Dimensions for Property Uploads in WPResidence
MLSImportWordPress IDX Plugin for MLS ListingsImport MLS listings into your WordPress website, customize your property pages, and keep your inventory updated.Start free 30-day trial →

Help Categories

  • 111 Installation & Changelog
  • 19Agent, Agency & Developers
  • 5Blog Posts & Blog Lists
  • 14Footer
  • 38Header
  • 2IDX & MLSImport
  • 23Maps & Location Settings
  • 50Multilingual Websites – WPEstate Translate (Included)
  • 21Pages & Page Templates
  • 4Payments & Monetization
  • 20Property Lists, Categories & Archive
  • 38Property Single Page
  • 32Search & Filtering
  • 170Technical how to | Custom Code
  • 9Technical: Actions and filters
  • 6Technical: Child Theme
  • 86Theme Options & Global Settings
  • 6Theme Translation & Localization
  • 28Third Party Plugins Compatible
  • 16WPBakery Shortcodes
  • 51WPResidence / WPEstate CRM
  • 9WPResidence Elementor Studio
  • 39WPResidence Elementor Widgets
  • 79WPResidence FAQ

Join Us On

Powered by WP Estate - All Rights Reserved
  • WPRESIDENCE
  • Video Tutorials
  • Client Support
  • API