Jump to content
  • Advertisement
Sign in to follow this  
utilae

Price Brackets

This topic is 4062 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I'm wanting to know a formula that I could use to drop the price of an item based on quantity, but to have the price start at a maximum price and not drop below a minimum price. Here are the variables I can imagine using: MinPrice eg $2.40 MaxPrice eg $0.90 MinQty, MaxQty, Qty eg 1 to 100 This is basically what I have: Price=(MaxPrice-(Qty*((MaxPrice-MinPrice)/(MaxQty-MinQty)))) It still drops below the minimum price though, and I could probably stop that with 'logic' (eg if), but I'm interested in what is best. Thanks for any help.

Share this post


Link to post
Share on other sites
Advertisement
Using your formula and values:

Price=(MaxPrice-(Qty*((MaxPrice-MinPrice)/(MaxQty-MinQty))))
Price=(2.40-(100*((2.40-0.90)/(100-0))))
Price=(2.40-(2.40-0.90)
Price=0.9 which is the min price..

Share this post


Link to post
Share on other sites
Ok, I guess the answer I have is good enough.

Though I did improve it a bit cause I want it like so:

Qty
1 for $2.40 each
..
100 for $0.90 each

And this does it:

Price=(MaxPrice-((Qty-1)*((MaxPrice-MinPrice)/(MaxQty-MinQty))))

Where:
MinPrice=0.90
MaxPrice=2.40
MinQty=1
MaxQty=100

Thanks anyway.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!