If I run this simple calculation in C# the value is completely different than Excel or Win calculator.
var result = (300 / 250 * 4.3M * 25);
In c# the result is 107.5
In Excel and Windows Calculator the result is 129
What am I doing wrong?
If I run this simple calculation in C# the value is completely different than Excel or Win calculator.
var result = (300 / 250 * 4.3M * 25);
In c# the result is 107.5
In Excel and Windows Calculator the result is 129
What am I doing wrong?
When you divide 300 with 250 - you divide 2 integers - so the results is 1 and not what you may expected - 1.2
When you do that in calculator the values are floating numbers and the results is 1.2 as expected
129 / 107 = 1.2