tags:

views:

45

answers:

2

What I mean is, is there some good way to dynamically calculate which user volume should get which % discount based around the discount growing as the volume grows?

I imagine it would either be a curved or a straight line on a graph but I am not exactly sure.

Is it possible that I could start with two ranges like: 25-500 users and 80-95% and then using those max/mins I can find the line it falls on and then be able to return a % when I specify a number of users? But this might not be making the discount grow at the rate that I want, this would be a straight line I think.

I hope I'm being transparent.

A: 

I believe this can provide some hints.

luvieere
A: 

Why not just an if block with ranges/fall-throughs?

In C++, it'd look like:

float discount = 0.0;
if(licenses > 25){
    discount = 0.05;
}
if(licenses > 100){
    discount = 0.10;
}
if(licenses > 500){
    discount = 0.15;
}
// more ranges as needed

Seems the easiest route to me :)

warren