Done Adding '+' to positive numbers

May 20, 2008
12,175
133
Syracuse, NY, USA
Sometimes, I'd like to express positive numbers with a '+'. If there's a built-in way to do it I am unaware of it. I can do it with @IF but that's cumbersome, especially on the command line.

Perhaps @EVAL's output format specification, normally =(E|H|B|i[.a]) could be given another (optional) parameter ... =(E|H|B|i[.a])[+] to indicate that a '+' is desired on positive numbers (0 too?).

Or maybe @FORMATN could be overloaded somehow to do this.
 
May 29, 2008
572
4
Groton, CT
Sometimes, I'd like to express positive numbers with a '+'. If there's a built-in way to do it I am unaware of it. I can do it with @IF but that's cumbersome, especially on the command line.

Perhaps @EVAL's output format specification, normally =(E|H|B|i[.a]) could be given another (optional) parameter ... =(E|H|B|i[.a])[+] to indicate that a '+' is desired on positive numbers (0 too?).

Or maybe @FORMATN could be overloaded somehow to do this.
Here's a hint for a workaround:
Code:
for /l %n in (-1,1,1) echo %n %@replace[--,+,-%@eval[-(%n)]]
-1 -1
0 -0
1 +1