Title: number_format() PHP error
Last modified: September 13, 2023

---

# number_format() PHP error

 *  Resolved [Jan Wittler | Wittler Web GmbH](https://wordpress.org/support/users/bloggingwelt/)
 * (@bloggingwelt)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/number_format-php-error/)
 * Hi,
   we are facing the following error:
 *     ```wp-block-code
       PHP Warning:  number_format() expects parameter 2 to be int, string given in /wp-content/plugins/wp-travel-engine/includes/helpers/helpers-prices.php on line 65
       ```
   
 * Running on PHP 8, on PHP 7.4 it even causes a fatal error.
 * What can we do?
 * Kind regards,
   Jan

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Thread Starter [Jan Wittler | Wittler Web GmbH](https://wordpress.org/support/users/bloggingwelt/)
 * (@bloggingwelt)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/number_format-php-error/#post-17048878)
 * Addition:
 * It now even throws a fatal error on PHP 8 but i noticed it only appears when 
   I upgrade Polylang from version 3.3 to the newest, when I restore back the problem
   is away. Here is the stacktrace:
 *     ```wp-block-code
       PHP Fatal error:  Uncaught TypeError: number_format(): Argument #2 ($decimals) must be of type int, string given in /wp-content/plugins/wp-travel-engine/includes/helpers/helpers-prices.php:65
       Stack trace:
       #0 /wp-content/plugins/wp-travel-engine/includes/helpers/helpers-prices.php(65): number_format(270, '', ',', '.')
       #1 /wp-content/plugins/wp-travel-engine/includes/helpers/class-wte-price.php(51): wte_number_format(270)
       #2 /wp-content/plugins/wp-travel-engine/includes/helpers/class-wte-price.php(39): WPTravelEngine\Utilities\Price->get_formated_number(270)
       #3 /wp-content/plugins/wp-travel-engine/includes/helpers/class-wte-price.php(67): WPTravelEngine\Utilities\Price->replacer(270)
       #4 /wp-content/plugins/wp-travel-engine/includes/helpers/helpers-prices.php(108): WPTravelEngine\Utilities\Price->format(true)
       #5 /wp-content/plugins/travel-agency-companion/includes/class-travel-agency-companion-functions.php(132): wte_get_formated_price(270)
       #6 /wp-content/plugins/travel-agency-companion/public/sections/popular.php(91): Travel_Agency_Companion_Functions->travel_agency_trip_symbol_options(4520, 'EUR', '&euro;')
       #7 /wp-content/themes/travel-agency-pro/inc/extras.php(270): require_once('...')
       #8 /wp-content/themes/travel-agency-pro/front-page.php(23): travel_agency_pro_get_template_part('popular')
       #9 /wp-includes/template-loader.php(106): include('...')
       #10 /wp-blog-header.php(19): require_once('...')
       #11 /index.php(17): require('...')
       #12 {main}
         thrown in /wp-content/plugins/wp-travel-engine/includes/helpers/helpers-prices.php on line 65
       ```
   
 *  Plugin Support [Manjil Nepali](https://wordpress.org/support/users/manjilnepali/)
 * (@manjilnepali)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/number_format-php-error/#post-17049490)
 * Hello [@bloggingwelt](https://wordpress.org/support/users/bloggingwelt/),
 * Thank you for contacting WP Travel Engine team!
 * The error you’ve encountered is related to an empty field under **“Decimal digits”.**
   You can resolve this issue by entering a numerical value for Decimal Digits in
   your admin dashboard. To do this, please navigate to **Admin Dashboard > WP Travel
   Engine > Settings > MISCELLANEOUS > Currency Settings.** Once you’ve added the
   required value, kindly verify if the issue persists. You can refer to this screenshot
   for assistance: [https://prnt.sc/O9SuWwjWuf&#8211;](https://prnt.sc/O9SuWwjWuf--)
 * Your cooperation in resolving this matter is greatly appreciated.
 * If you have any queries or confusion later, please let us know, and we will be
   back.
 * Thank you!
 *  Thread Starter [Jan Wittler | Wittler Web GmbH](https://wordpress.org/support/users/bloggingwelt/)
 * (@bloggingwelt)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/number_format-php-error/#post-17060147)
 * Hi [@manjilnepali](https://wordpress.org/support/users/manjilnepali/),
   Thank 
   you for your great support!The issue is resolved now after I replaced the value
   0 by 2.Have a great day!Kind regards,Jan
 *  Plugin Support [Manjil Nepali](https://wordpress.org/support/users/manjilnepali/)
 * (@manjilnepali)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/number_format-php-error/#post-17060599)
 * Hello [@bloggingwelt](https://wordpress.org/support/users/bloggingwelt/),
 * I’m glad I could assist you. I have a small favor to ask. Would you consider 
   sharing your experience with WP Travel Engine by writing a review on WordPress.
   org?
 * [Click here to leave a review for WP Travel Engine on WordPress.org.](https://wordpress.org/support/plugin/wp-travel-engine/reviews/)
 * Upon clicking the link, you’ll be directed to our service review page. Please
   select a rating that best describes your experience with us. It’ll take less 
   than 5 minutes of your time.
 * Your feedback helps us better cater to your needs and guides others in making
   informed decisions about WP Travel Engine. Whether or not you choose to leave
   a review, please know that we deeply value your trust in us.
 * I look forward to assisting you again in the future!
 * Thank you!

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘number_format() PHP error’ is closed to new replies.

 * ![](https://ps.w.org/wp-travel-engine/assets/icon-256x256.png?rev=3161831)
 * [WP Travel Engine - Tour Booking Plugin - Tour Operator Software](https://wordpress.org/plugins/wp-travel-engine/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-travel-engine/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-travel-engine/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-travel-engine/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-travel-engine/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-travel-engine/reviews/)

## Tags

 * [php-error](https://wordpress.org/support/topic-tag/php-error/)

 * 4 replies
 * 2 participants
 * Last reply from: [Manjil Nepali](https://wordpress.org/support/users/manjilnepali/)
 * Last activity: [2 years, 8 months ago](https://wordpress.org/support/topic/number_format-php-error/#post-17060599)
 * Status: resolved