by bazoom42 · 2w ago · 0 comments
Hell, on the rare occasion I've needed to use a decimal literal in code, I just use a decimal literal: don't do (decimal)0.1, just use 0.1m.
Then you dont need the cast and there is no problem with hidden roundings.
I know. It shouldn't be.
I hope this is a compiler warning at the least.
If the conversion is safe (eg converting from an integer to decimal) then the cast syntax is unnecessary.