Cannot set rate past 2 decimal places

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?

Posted in

Comments

3 responses to “Cannot set rate past 2 decimal places”

  1. Perfect!!

  2. Hi George,

    This has solved my issue.

    Thank you
    Mat

  3. 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

Share