By registering with us, you'll be able to discuss, share and private message with other members of our community.
SignUp Now!Watch this:
C:\Programme\TCMD
> function currency=`%@comma[%@formatn[-70.2,%1]]`
C:\Programme\TCMD
> echo %@currency[741,31]
741,00
C:\Programme\TCMD
> echo %@comma[%@formatn[-70.2,741,31]]
741,31
How can this be?
Greetings WB
In the first example, the first comma is a parameter separator. It separates the first argument to your function (741, which becomes %1) from the second (31, which becomes %2 and is duly ignored.)
In the second example, @FORMATN is expecting only two arguments. The second comma therefore can't be a parameter separator -- it's a thousands separator (and is ignored.) Your second argument is simply 74131 -- or 74,131 if you insert thousands separators.
Sorry, but this is wrong. I have the german settings. Watch this:
C:\Programme\TCMD
> function currency=`%@comma[%@formatn[-70.2,%1]]`
C:\Programme\TCMD
> echo %@currency[13741,31]
13.741,00
C:\Programme\TCMD
> echo %@comma[%@formatn[-70.2,13741,31]]
13.741,31
The thousands separators are set correctly and the @formatn also correctly recognizes the comma. The next lines show this:
C:\Programme\TCMD
> echo %@formatn[-70.2,13741,31]
13741,31
C:\Programme\TCMD
> echo %@comma[13741,31]
13.741,31
Everything is fine -- but not as a function.
Greetings WB
function currency=`%%1 is %1 - %%2 is %2 - %%3 is %3`
echo %@currency[13741,31]
function currency=`%@comma[%@formatn[-70.2,%$]]`
echo %@currency[13741,31]