Cannot set rate past 2 decimal places

Posted in

I am trying to set a rate of 0.095 (9.5%), however, when I do this and save the setting, affiliates pro starts calculating the rate as if it were 9%, which is wrong. What is the fix for this?

3 Responses to Cannot set rate past 2 decimal places

  1. George April 28, 2018 at 3:11 pm #

    Perfect!!

  2. Mathew April 27, 2018 at 5:44 pm #

    Hi George,

    This has solved my issue.

    Thank you
    Mat

  3. George April 27, 2018 at 3:34 pm #

    Hi Mathew,

    Regarding decimals, you need to use the following snippet in your functions.php file of your theme.

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

    this snippet will use 2 decimals for displaying and 3 for calculations. The detailed description for the filter affiliates_referral_amount_decimals can be found here.

    Kind regards,
    George

We use cookies to optimize your experience on our site and assume you're OK with that if you stay.
OK, hide this message.

Affiliates · Contact · Jobs · Terms & Conditions · Privacy Policy · Documentation · Downloads · Useful Plugins · My Account

Share