Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Done Adding '+' to positive numbers

May
12,939
171
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.
 
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
 
Back
Top