I’m using C# and I have many integers.
I was wondering if there was a numeric format string that would display the following:
12
as
+12
This is needed as the application I’m working with is mathematical, and when attempting to display something like x + y when x = 2 and y can be either -2 or say for instance 3. I don’t want to be displaying:
2 + -2 and 2 + 3
if you understand what I am getting at.
Thanks in advance.
I don’t believe there’s a standard format string that does that, but you could use:
That will give “+1234”, “-1234” and “+0” for values 1234, -1234 and 0 respectively. I think that’s what you wanted.