7 Replies Latest reply on May 5, 2015 8:06 PM by disabled_jackrodgers

# Calculation:

I need help with a calculation.

I have a price field and a current price field. We will be lowering our price by 5 % and that becomes our current price.

current price = price - 5%

Thanks

• ###### 1. Re: Calculation:

Try:

CurrentPrice * 0.95

• ###### 2. Re: Calculation:

Or, rather:

CurrentPrice = OldPrice * 0.95

• ###### 3. Re: Calculation:

Thanks Mike.

• ###### 4. Re: Calculation:

Only thing to think about here is use of the calculation..

i.e what happens to price when you want to remove the discount? Do some orders need the discount and others do not? Do you need to keep history of when and to what the discount was applied?

• ###### 5. Re: Calculation:

This is a straight forward discount, nothing complicated.

• ###### 6. Re: Calculation:

Give some thot to not hard-coding the 0.95 into your formula. Instead create a global field (which I'll call DiscountRate) and use the formula

CurrentPrice = OldPrice * (1 - DiscountRate)

Then, any time you want to drop the discount, you just revert the contents of the DiscountRate field from .05 to 0. Next time you want to give a discount (say, 3%), you enter .03 in that field, and you're good to go again without ever having to poke around under the covers.

• ###### 7. Re: Calculation:

Everything is straightforward and simple until the owner has a new idea...

You might include an on off checkbox field, Apply Discount.

Then the calc can be made:

If apply discount = yes

old price * .95

else

old price

end if

and one more step a discount field = xx5

If apply discount = yes

old price * (100-discountfield)

else

old price

end if

These two fields add a bit of value to the process...