Decimal places

In the total tab the values of commas appear with 6 decimal places, I want to change to 2.


Comments

3 responses to “Decimal places”

  1. George Avatar

    Please try the following steps.
    1. Make sure that you added the snippet to the functions.php file of your active theme.
    2. Enable WP debugging, visit the totals page and check if anything is logged in the debug.log file.
    3. If there is nothing logged in the debug.log, delete the snippet, take a full backup of your wp-config.php and then add the following lines.

    define( 'AFFILIATES_REFERRAL_AMOUNT_DECIMALS', 4 );
    define( 'AFFILIATES_REFERRAL_AMOUNT_DECIMALS_DISPLAY', 2 );

    In any case please let me know the result.

    To enable debugging, edit your wp-config.php file and replace the following line:
    define('WP_DEBUG', false );
    with these lines:


    define('WP_DEBUG', true );
    define('WP_DEBUG_LOG', true );
    define('WP_DEBUG_DISPLAY', false );

    after that, any errors will be added to a file named debug.log under your wp-content folder.

    Kind regards,
    George

  2. Ladyston Avatar
    Ladyston

    I did the procedure but it did not work, strange thing is that when I was using the free it was normal, I bought the pro and it happened.

  3. George Avatar

    Hi Ladyston,

    You should add the following snippet to the functions.php file of you child theme( if present ).

    function affiliates_change_decimals_example( $decimals, $context ) {
    if ( $context === 'display' ) {
    $decimals = 2;
    } else {
    $decimals = 6;
    }
    return $decimals;
    }
    add_filter(
    'affiliates_referral_amount_decimals',
    'affiliates_change_decimals_example'
    );

    Kind regards,
    George

Share