Let’s say you have the following three numbers:
…and you’d like to format them as follows:
There’s a special format string that can be used for this purpose. It consists of 3 parts separated by a semi-colon. The first part applies to positive numbers, the second to negative numbers and the third to zeroes:
…and here’s the output:
View all various C# language feature related posts here.
View original post 1 more word