Everyday Work with Numbers: Math, Rounding Modes, Random.Shared, Guid v4/v7 and BigInteger
Math.Round rounds to even by default (2.5 → 2) while decimal formats round away from zero, so for money pass the mode explicitly and round before formatting. Using Bookstore's campaign discount we show MidpointRounding modes, the double-for-money bug and the .NET 11 decimal conversion change, thread safety with Random.Shared, how Guid v7 sorts, and BigInteger, all with real output.
15 Nov 2026
·
16 min
·
13