How can I concatenate numbers in a package?

For example, I have numbers 5, 3, 8, 2, 7, 4 and 9, which I received from operations such as 2+2 , 7-2 and 3*3 , etc. .... All of them are stored in variables. I want to know if there is a way that I can dynamically concatenate in batch files to get a result like the line "5382749". With up to 6 digits, I can do %v1%%v2%%v3% ... but after that I get "Invalid number. Numbers are limited to 32-bit precision." error. What I'm trying to do is echo a certain number of concatenated digits on the command line. Thanks in advance.

+4
source share
1 answer

Yes, thatโ€™s easy. Small sample

 set /a num1=2+2 set /a num2=7-2 set /a num3=4 set concat=%num1%%num2%%num3% echo %concat% 
+3
source

Source: https://habr.com/ru/post/1345543/


All Articles