I am working on my parsercomp game and need a little math help. I want to have in my trading system a dynamic pricing based on durability of the item. I am thinking starting with a base price at 100% durability as one of the properties to work with. Eg. crowbar 100 Durability = $50.

My question how would i do the calculation? i know Adrift cannot do decimals. Lets say the crowbar in question has a durability of 65. What would the equation look like for reducing its price?

## Some math help needed

### Re: Some math help needed

Since ADRIFT cannot handle decimals the order becomes important, i.e. if you divide by 100 first or if you multiply by duration first.

Thus, the new price can be calculated as:

New price = %price100%*%durability%/100 (do NOT this: %price100%/100*%durability% as the result will be wrong)

However, I prefer to add some parentheses to make it absolutely clear what happens first, i.e.:

New price = (%price100%*%durability%)/100 (the multiplication must happen before the division)

If the new price is a part of a bigger calculation, the parentheses could become important.

Thus, the new price can be calculated as:

New price = %price100%*%durability%/100 (do NOT this: %price100%/100*%durability% as the result will be wrong)

However, I prefer to add some parentheses to make it absolutely clear what happens first, i.e.:

New price = (%price100%*%durability%)/100 (the multiplication must happen before the division)

If the new price is a part of a bigger calculation, the parentheses could become important.

----------------------------------------------------------------------

The Bash Saga:

1. The Dragon Diamond 2. The Way Home 3. Stone of Wisdom

----------------------------------------------------------------------

The Bash Saga:

1. The Dragon Diamond 2. The Way Home 3. Stone of Wisdom

----------------------------------------------------------------------

### Re: Some math help needed

Thanks for that Denk. Just what i wanted.