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.

397 views      
Thread locked
 

Messages in this Thread

 
95,067 Postings in 11,984 Threads, 350 registered users, 72 users online (0 registered, 72 guests)
Index | Admin contact |   Forum Time: Aug 7, 2020 - 11:38 am EDT  |  Hits:32,931,467  (14,508 Today )
RSS Feed