WooCommerce - excelling eCommerce
[resolved] Decimals not working at price (8 posts)

  1. manfredschmutz
    Posted 1 year ago #

    I have set 2 decimals in the settings to display the price. But the settings are not working, because the price is always shown without decimals.
    It looks like the method wc_price() is always returning the price without the correct amount of decimals set in the settings.

    the url of the site is: http://www.kdm-edelsteine.ch

    Thanks in advance for your help


  2. PhaseCreative
    Posted 1 year ago #

    I am also having this problem. Is there a known fix for it yet?

    Thank you.

  3. tesser00
    Posted 1 year ago #

    I have the same problem but only if the price are with two zero after comma.
    32,00 --> 32
    32,99 --> 32,99

    Olso in the product administration (list) the price are without ,00.

    I have woocommerce 2.1.2 and WP 3.8.1

    My Catalog page: http://www.funtasticschool.it/shop/


  4. manfredschmutz
    Posted 1 year ago #


    Try the solution described in this topic: http://wordpress.org/support/topic/where-are-the-decimals

    it helped me to solve the problem



  5. Coen Jacobs
    Posted 1 year ago #

    In WooCommerce 2.1.3 this will default to show the zeros after the comma again.

    We've made this change, but will revert it in the next fix release.

    To fix it now, use this code (it will be forward compatible with our fix):

    add_filter( 'woocommerce_price_trim_zeros', '__return_false' );

  6. feuerkralle
    Posted 1 year ago #

    Hello Everybody!
    Related to this topic i have an additional problem with price formatting:
    In the currency settings the seperator for decimal and thousands doesn't work:

    My Settings:
    Seperator für thousands: .
    Seperator für decimal: ,

    But the result is i.e. 36.00 instead of 36,00

    Will this problem fixed with the next release too?

  7. lucawater
    Posted 1 year ago #

    I added "add_filter( 'woocommerce_price_trim_zeros', '__return_false' );" to my functions.php file, but i'm still not seeing the zeros

  8. lucawater
    Posted 1 year ago #

    The only place where the price is displayed properly is at cart content(so with: "$woocommerce->cart->get_cart_total();").

    None of the settings seem to apply to the other price. My settings are:
    Thousand seperator: .
    Decimal seperator: ,
    Number of decimals: 2

    When I fill in 5,95 as price, it returns "5.95"(so with a dot instead of comma)
    when I fill in 5 as price, it returns "5"(so without the comma and two zeros)

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WooCommerce - excelling eCommerce
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic