WP Residence Help WP Residence Help

  • WPRESIDENCE
  • Video Tutorials
  • Client Support
  • API
Home / Technical how to | Custom Code / Technical – how to always show decimals for price even when 00

Technical – how to always show decimals for price even when 00

890 views 0
The development team recommends a quick change if you want to always display a decimal portion in prices—even when the value ends with .00.
1. Open wpresidence/libs/help_functions.php in the parent theme (tested with WPResidence theme version **5.3.2.1**).
2. Locate the wpestate_format_number_price function. In version 5.3.2.1 it appears around line **1179** —search for number_format( $price, 0 ) inside the helper if the line number drifts in later releases.
3. Update the call to number_format() so that the **decimals** argument is 2 instead of 0. This forces prices to show two decimal places.
If you are using a child theme (recommended), copy the wpestate_format_number_price function into the child theme first:
1. The function is wrapped in if ( ! function_exists( ‘wpestate_format_number_price’ ) ), which makes it child-theme ready.
2. Copy the entire function into the child theme’s functions.php (or an included file).
3. Modify the copied version there so the decimals argument is set to 2. Making the edit inside the child theme ensures the change persists after parent theme updates.

​
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