Originally Posted by Seerah
Bah, I missed that second f.
|
We still love you.
Originally Posted by Grimsin
Regardless of what method i use there is an issue with the code... when you floor the math for the cost of the repair the calculations for the faction discounts become off by up to 2 copper... or at least ive seen it up to 2copper its off by one copper most of the time.
|
Blizz could be rounding it, in which the formula for rounding is:
Code:
x=math.floor(y+0.5);
Either that or they could be using
math.ceil() which shifts the number up to the nearest integer instead of just dropping the decimal. This is actually used most in PoS (Point of Sale) programs where fractional cents in line totals are always rounded up. This is to cover the suggested price of an item while erring on the side of being over instead of short money.