• Resolved bbillman89

    (@bbillman89)


    I’m attempting to remove the .00 from my bulk pricing column. I would assume using a round() somewhere in the following code would achieve this:

    (<?php
    echo wp_kses_post( wc_price( wc_get_price_to_display( wc_get_product( $product_id ),
        array(
            'price' => $current_price,
        ) ) ) ) ;
    ?> each)

    However, when I add the round() before wc_price I’m returned 0. My original thought was to add it in the array() but I can’t seem to get that to work either.

    Thank you in advance.

    • This topic was modified 3 years, 9 months ago by bbillman89.

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author WP Developer

    (@bycrik)

    Hi @bbillman89,

    wc_price function has an additional option, where you can override the standard price format:

    
    <?php
    echo wp_kses_post( wc_price( wc_get_price_to_display( wc_get_product( $product_id ),
        array(
            'price' => $current_price,
        ) ), ['decimals' => 0] ) );
    ?> each)
    Thread Starter bbillman89

    (@bbillman89)

    Awesome! Thank you

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Remove Decimals from Price’ is closed to new replies.