Title: Uncaught TypeError: round()
Last modified: October 9, 2024

---

# Uncaught TypeError: round()

 *  Resolved [raidenelite](https://wordpress.org/support/users/raidenelite/)
 * (@raidenelite)
 * [1 year, 8 months ago](https://wordpress.org/support/topic/uncaught-typeerror-round/)
 * Hello,
 * i kept having this error in my logs:
   `Uncaught TypeError: round(): Argument #
   1 ($num) must be of type int|float, string given in /httpdocs/wp-content/plugins/
   woo-product-feed-pro/classes/class-get-products.php:3373`
 * so i added some logging and find out that the code at that line, which is:
 * `$product_data[ $rounded_key ] = round( number_format( $product_data[ $price_key],
   $number_of_decimals, $decimal_separator, $thousand_separator ), $rounded_precisions,
   $rounded_mode );`
 * returned a string to round(), if you give a number to number_format say like 
   20000 (the one i had problems with), it will return 20.000,00, but round() wants
   a int
 * i fixed it by doing round first and format later
 * `$product_data[ $rounded_key ] = number_format( round( $product_data[ $price_key],
   $rounded_precisions, $rounded_mode ), $number_of_decimals, $decimal_separator,
   $thousand_separator );`
 * now i can generate my feeds, because before i couldn’t..
   Can you please check
   on this further and see if it actually requires a fix?
 * Thanks

Viewing 1 replies (of 1 total)

 *  Plugin Support [Tanjir Al Mamun](https://wordpress.org/support/users/tanjiralmamun/)
 * (@tanjiralmamun)
 * [1 year, 8 months ago](https://wordpress.org/support/topic/uncaught-typeerror-round/#post-18064453)
 * Hello [@raidenelite](https://wordpress.org/support/users/raidenelite/),
 * We’ve released a patched. Updating the plugin should resolves the issue.
 * Cheers!

Viewing 1 replies (of 1 total)

The topic ‘Uncaught TypeError: round()’ is closed to new replies.

 * ![](https://ps.w.org/woo-product-feed-pro/assets/icon-256x256.png?rev=3111496)
 * [Product Feed PRO for WooCommerce by AdTribes – Product Feeds for WooCommerce](https://wordpress.org/plugins/woo-product-feed-pro/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woo-product-feed-pro/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woo-product-feed-pro/)
 * [Active Topics](https://wordpress.org/support/plugin/woo-product-feed-pro/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woo-product-feed-pro/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woo-product-feed-pro/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Tanjir Al Mamun](https://wordpress.org/support/users/tanjiralmamun/)
 * Last activity: [1 year, 8 months ago](https://wordpress.org/support/topic/uncaught-typeerror-round/#post-18064453)
 * Status: resolved