ZTree.com  | ZEN  | About...  

 Index   Back

[Q] how do i test if a string is a number?   [Q]

By: Ryan       
Date: Aug 27,2017 at 20:12
In Response to: [Q] how do i test if a string is a number? (Nick Williams)

>I found them all to be either too fragile or incomplete/inaccurate.
i found this true, one website that Martijn Coppoolse's showed , all of scripted worked and at the same time all of them didnt work.

even the idea that i had about causing "the divided by 0" to test it, it didnt reconcile with the OS's SET /A function itself at the end. because SET /A B=2T returns it as a number string 2 and not as 0.

"2 space 3" is a string, but one script treats this as a number.

and another script case, "space 23" is a number. but this script treats it as a string, this script can not do a negative number, it was testing a digit by a digit not as a whole.

another script, 000002 is a number string, but it couldnt match it with 2 as a number string in its test

all failed and all worked in their limits. i had to accept the limits in the world of batch.

>You are very welcome to have this -- are you interested ?
yes, if numbers? am all ears. and i get to know more about batches.

286 views      
Thread locked
 

Messages in this Thread

 
94,590 Postings in 11,932 Threads, 348 registered users, 14 users online (0 registered, 14 guests)
Index | Admin contact |   Forum Time: Nov 20, 2019 - 12:21 pm EST  |  Hits:29,198,741  (11,982 Today )
RSS Feed