consensusRealityIO / RSBP

Real Simple Bitcoin Payments
GNU General Public License v3.0
14 stars 25 forks source link

Price Calculation and Discounting #2

Closed dykstranet closed 9 years ago

dykstranet commented 9 years ago

Add variable "discount"

Add function "applyDiscount"

Add flexibility to pricing with a "discount" variable. The discount variable will take value of variable "rate" and adjust the value by the variable "discount" percent. So if the variable "discount" is -5 and the value of rate is 100, calling function "applyDiscount" changes the variable "rate" to 95. "applyDiscount" should also work with positive numbers. For example, if "discount" is 5, then "applyDiscount would return 105.

dykstranet commented 9 years ago

This feature has been added.