Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7940245
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T23:19:54+00:00 2026-06-03T23:19:54+00:00

Sounds like an easy question, I know. I am literally stumped. Here are two

  • 0

Sounds like an easy question, I know. I am literally stumped.

Here are two websites that have made the simple calculator:

http://thefeecalculator.com

http://ppcalc.com

I’m needing to calculate these PayPal’s fees in my PHP application.

Here’s what I got, say we wanted to be paid $30 “even” for membership fees. This is the function I’m using to calculate what we should charge to make up for it using PayPal’s calculations (also described on both of the sites above): 2.9% of the transaction + $0.30.

function memfees()
{
    $calc = round((30 * .029) + 30 + .30,2);
    return $calc;
}

Test it here: http://matt.mw/junk/php/memfees.php
As you can see, it says 31.17.
Both of the other websites say it should be 31.20.
If I try $130.00, mine calculates to $134.07 and both of theirs calculate to $134.19.

What am I doing wrong?

Why am I using a Round function? Percentages cause some decimals to go past the hundredths place, and PayPal generates an error if there is more then 2 digits after the decimal. I thought people normally round money, (e.g. $31.6342 will be $31.63) but if that is the case, what am I doing wrong in my function? The amount that is off is further if there are large payments. This leads me to believe that something is wrong with the percentage portion.

Could you offer some help on this?

Thank you for your time.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T23:19:55+00:00Added an answer on June 3, 2026 at 11:19 pm

    Your function does seem strange. To break it down, PayPal is charging a fixed rate of $.30, and adding a transaction percentage fee of 2.9%.

    The formula for this is to add the $.30 and then divide by the percentage difference (100% – 2.9%), which will give you the amount prior to the actual reduction by PayPal.

    function memfees($amount)
    {
        $amount += .30;
        return $amount / (1 - .029);
    }
    

    You can round and float that as you wish.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know that the question sounds like this is going to be an easy
I know this sounds like an easy question but for some reason I just
This sounds like a really simple question, but I am new to PHP. If
I know it probably sounds like very trivial question but I couldn't find any
I know this sounds like a dumb question but I need to ask this.
sounds like very easy question but very often I am confused by this. Please
How can I override Hudson build number? It sounds like an easy question, but
I know that at the end my question me sound silly and easy to
This sounds like a pretty easy question to answer but I haven't been able
I'm new to C++, and I have a question that should be easy, but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.