• Resolved nappa5150

    (@nappa5150)


    I would like to show prices as written in admin page. The problem is the decimals: I have products with € 10,50 but I have also products with € 0,0850. If I set num of decimals to 2 in Woo Settings page it’s OK for 10,50 but not for € 0,0850 that writes € 0,09. If I set decimals to 4 it’s OK for € 0,0850, but not for 10,50 that becomes 10,5000. thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hello @nappa5150 ,

    I understand your expected outcome.

    According to this developer documentation, you can hide the trailing zeros from your price. You can add this code to your theme’s functions.php file –

    /**
     * Trim zeros in price decimals
     **/
     add_filter( 'woocommerce_price_trim_zeros', '__return_true' );

    I hope this helps.

    Thank you ??

    Hi there,

    We’ve not heard back from you in a while, so I’m marking this thread as resolved.

    Hopefully, you were able to find a solution to your problem! If you have further questions, please feel free to open a new topic.

    Thank you ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Display prices as written’ is closed to new replies.