markjprice / cs11dotnet7

Repository for the Packt Publishing book titled "C# 11 and .NET 7 - Modern Cross-Platform Development Fundamentals" by Mark J. Price
566 stars 206 forks source link

Output complex numbers using default ToString implementation #50

Closed MAS-OUD closed 1 year ago

MAS-OUD commented 1 year ago

On page 357, by running the line WriteLine($"{c1} added to {c2} is {c3}"); I get <4; 2> added to <3; 7> is <7; 9> instead of (4, 2) added to (3, 7) is (7, 9)

markjprice commented 1 year ago

I initially thought this might be because number formats are culture-specific. But it seems to either be a deliberate change in behavior, or a bug, but the official documentation still shows the same formatting as I do in the book and worked in .NET 6. Regardless, I have created an item for this: https://github.com/markjprice/cs11dotnet7/blob/main/docs/errata/errata.md#page-357---working-with-complex-numbers