Support » Plugin: WooCommerce » More decimals for TAX at Frontend

  • Resolved yano23

    (@yano23)


    Hi, this is a simple question but I haven’t been oble to modify this.

    I’m using a currency that has decimals.
    I’m showing just 1 decimal…so price looks like $0,2 or $1,2
    I would like that tax calculation show more decimals.
    right now for 0,2 it shows a tax of 0,0 when the correct one is 0,038 (tax is 19%)

    I know at the backend more decimals are considered but I need to show clients an exact price. Displaying prices with 4 decimals or so (like 1,0000) is not an option, I need just 1 decimal. So my questions is: How to have only the TAX field show more decimals? Thank you

    • This topic was modified 5 months, 3 weeks ago by  yano23.
Viewing 1 replies (of 1 total)
  • Solved with this:

    add_filter( ‘wc_get_price_decimals’, ‘change_prices_decimals’, 20, 1 );
    function change_prices_decimals( $decimals ){
    if( is_cart() || is_checkout() )
    $decimals = 3;
    return $decimals;
    }
    Thanks

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.