Skip to content

Instantly share code, notes, and snippets.

@wulab
Last active April 23, 2021 11:30
Show Gist options
  • Save wulab/6ad8844526b013f1238b9e68e493a71b to your computer and use it in GitHub Desktop.
Save wulab/6ad8844526b013f1238b9e68e493a71b to your computer and use it in GitHub Desktop.
def graduated_price(users)
if users <= 3
return 0
elsif users <= 10
return graduated_price(3) + 5 * (users - 3) + 15
elsif users <= 14
return graduated_price(10)
elsif users <= 17
return graduated_price(14) + 25
elsif users <= 24
return graduated_price(17) + 25
elsif users <= 28
return graduated_price(24) + 50
elsif users <= 46
return graduated_price(28) + 50
elsif users <= 55
return graduated_price(46) + 50
elsif users <= 100
return graduated_price(55) + 50
elsif users <= 149
return graduated_price(100) + 50
elsif users <= 199
return graduated_price(149) + 70
elsif users <= 499
return graduated_price(199) + 80
else
return graduated_price(499) + 1500
end
end
@wulab
Copy link
Author

wulab commented Apr 23, 2021

Pro

@wulab
Copy link
Author

wulab commented Apr 23, 2021

users monthly price
0-3 0
4 20
5 25
6 30
7 35
8 40
9 45
10-14 50
15-17 75
18-24 100
25-28 150
29-46 200
47-55 250
56-100 300

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment