Pls Help: Calculate discount % for free messages

shikha8690

New member
Joined
Sep 6, 2017
Messages
4
In the system that I am working on, a messaging module, where user can buy PACKAGES of messages which s/he can send to other users. Now while buying the packages, user can apply discount codes to get extra/free messages.

e.g. Package1 costs 1000 USD and user gets 100 messages in this package. Now user applies discount code and gets 10 messages free.

How to calculate the total discount % on this purchase as user is getting 10 free messages.
 
… user can buy PACKAGES of messages …

… while buying the packages, user can apply discount codes to get extra/free messages.

e.g. Package1 costs 1000 USD and user gets 100 messages in this package. Now user applies discount code and gets 10 messages free.

How to calculate the total discount % on this purchase as user is getting 10 free messages.
In your example, the user does not get extra messages; they get only the 100 messages that come in the package. They're just not paying for all 100 messages.

In other words, getting extra messages at no cost is a different situation than getting a discount on a set package.

One way to calculate the discount is by considering the message unit-price in the package, before the discount. If you get 100 messages for 1000 dollars, what is the price of each message?

Use this unit price to calculate the value of the 10 free messages. That value is the discount.

If you want to determine what percent of the whole price yields the discount, use the proportion which defines percent.

Part/Whole = %/100

If you need more help, please show what you've tried or thought about so far.

Be sure to read the forum guidelines, too. Thanks. :cool:
 
In your example, the user does not get extra messages; they get only the 100 messages that come in the package. They're just not paying for all 100 messages.

In other words, getting extra messages at no cost is a different situation than getting a discount on a set package.

One way to calculate the discount is by considering the message unit-price in the package, before the discount. If you get 100 messages for 1000 dollars, what is the price of each message?

Use this unit price to calculate the value of the free messages. That value is the discount.

If you want to determine what percent of the whole price yields the discount, use the proportion which defines percent.

Part/Whole = %/100

If you need more help, please show what you've tried or thought about so far.

Be sure to read the forum guidelines, too. Thanks. :cool:

Thanks, the purpose of this calculation is to show the user how much discount they are getting if they apply the discount code.

This is what I have done so far, I think I have done the same thing told by you but the calculation is quite long:

Discount % = (x*100)/(Amount+x)

where,
x = [(No. of free messages*Amount)/No. of messages]

where,
‘No. of free messages’ is the messages offered in the discount code.
‘Amount’ is the price of the package.
‘No. of messages’ is the messages offered in the package.
 
… I think I have done the same thing told by you …

Discount % = (x*100)/(Amount+x)

where x = (No. of free messages * Amount) / No. of messages

‘Amount’ is the price of the package

‘No. of messages’ is the messages offered in the package
Thanks for showing your work.

Your symbol x represents the discount (in dollars). Good job.

So, your question is: x is what percent of Amount?

Amount is the whole, x is the part. Substituting these expressions for part and whole in the proportion (defining percent) gives:

x/Amount = %/100

Solve for %, by multiplying each side by 100.

100x/Amount = %

You were very close! Delete the part highlighted in red above. :cool:
 
Out of curiosity, I worked the other scenario (extra messages). That is, instead of not paying for 10 messages in the package (i.e., "10 free messages"), the user gets 10 extra messages at no charge.

Maybe that's the scenario you have in mind because your formula works as is, in that case. I apologize, if we were talking apples and oranges!

A = amount of package

n = number of messages in package

f = number of extra messages at no cost

Your formulas are:

x = f*A/n

% = x*100/(A+x)

If you substitute the expression f*A/n for x, in the % formula, it simplifies to:

% = 100*f/(n+f)

This shows that A has no effect on the discount %, and it eliminates the need to calculate the value of x separately.

The example results:

Case 1 (user gets 100 messages, but pays only for 90 messages): discount is 10%

Case 2 (user gets 110 messages, but pays only for 100 messages): discount is 9.09% (rounded)
 
Out of curiosity, I worked the other scenario (extra messages). That is, instead of not paying for 10 messages in the package (i.e., "10 free messages"), the user gets 10 extra messages at no charge.

Maybe that's the scenario you have in mind because your formula works as is, in that case. I apologize, if we were talking apples and oranges!

A = amount of package

n = number of messages in package

f = number of extra messages at no cost

Your formulas are:

x = f*A/n

% = x*100/(A+x)

If you substitute the expression f*A/n for x, in the % formula, it simplifies to:

% = 100*f/(n+f)

This shows that A has no effect on the discount %, and it eliminates the need to calculate the value of x separately.

The example results:

Case 1 (user gets 100 messages, but pays only for 90 messages): discount is 10%

Case 2 (user gets 110 messages, but pays only for 100 messages): discount is 9.09% (rounded)

Yes, I am talking about case 2. So I guess I can go ahead with this calculation.
 
Out of curiosity, I worked the other scenario (extra messages). That is, instead of not paying for 10 messages in the package (i.e., "10 free messages"), the user gets 10 extra messages at no charge.

Maybe that's the scenario you have in mind because your formula works as is, in that case. I apologize, if we were talking apples and oranges!

A = amount of package

n = number of messages in package

f = number of extra messages at no cost

Your formulas are:

x = f*A/n

% = x*100/(A+x)

If you substitute the expression f*A/n for x, in the % formula, it simplifies to:

% = 100*f/(n+f)

This shows that A has no effect on the discount %, and it eliminates the need to calculate the value of x separately.

The example results:

Case 1 (user gets 100 messages, but pays only for 90 messages): discount is 10%

Case 2 (user gets 110 messages, but pays only for 100 messages): discount is 9.09% (rounded)

Thanks a ton. It really helped me a lot.
 
Top