Consider this code:
Console.WriteLine($"{-0.4m: ;-; }");
Console.WriteLine($"{-0.5m: ;-; }");
It prints
-
Is this a .NET bug?
CodePudding user response:
I believe it's due to rounding according to the documentation:
If the number to be formatted is nonzero, but becomes zero after rounding according to the format in the first or second section, the resulting zero is formatted according to the third section.