Here is my code:
Dim ex As String = "(((105 * 4000) * 0.20) - ((0 + 10000) * (105 * 4000)) / ((105 * 4000) + Round((52 * 18192.31),0))) / 24"
Dim x As New Expression(ex)
Dim result As Decimal = x.Evaluate
Console.WriteLine(result.ToString("N"))
it returns: 3,502.90, but when i compute it manually and thru excel the output I get is: 3371.888737
Here is the image of my manual computation...
3,502.90 * 24 = 84089.6
It is bigger than the first addend. And the second should be positive.
But you have overflow of 32-bit integer arithmetics in this expression
That is why the second addend becomes negative (and a1-(a2) > a1)
Probably it is enough to use doubles like this:
P.S. You don't execute rounding in manual writing