My first thought would be that both values are actually somewhere between
4.61 and 4.6149999. It may be that the numbers originated as doubles or
double constants and were explicitly converted to decimal someplace in your
code.
Be sure to use the "M" or "m" suffix for literal values being assigned to
decimal variables, e.g., 4.61M or 4.61m. Although supposedly there are no
implicit conversions in C# to the decimal type, 4.61 by itself will I
believe be interpreted as a double and then assigned to the decimal
variable, which may constitute an "explicit" conversion. I haven't checked,
but it wouldn't surprise me.
If you view the variables in the debugger, what numbers do you see in there?
--Bob
"Alberto" <al*****@nospam.com> wrote in message
news:%2******************@TK2MSFTNGP09.phx.gbl...
Actually I have two quantities (4.61) stored as decimal numbers.
Why if I try to sum them the result is 9.23 if the correct value is 9.22?
Thank you