decimal hundred = 100;
decimal value = 5000;
decimal sum = 1100000;
decimal valuePercentOfSum = value / sum * hundred; //result = 0.4545454545454545454545454500M
decimal percentOfSum = sum / hundred * valuePercentOfSum; //result = 4999.9999999999999999999999500M
I would expect the result of percentOfSum
to be the original value of value (5000)
I need a way to do calculations like this back and forth, and I can simply not do ANY rounding.
Any help?