Debian Codegraph @

awklib/eg/lib/isnumeric.awk

raw
1 # isnumeric --- check whether a value is numeric
2
3 function isnumeric(x, f)
4 {
5 switch (typeof(x)) {
6 case "strnum":
7 case "number":
8 return 1
9 case "string":
10 return (split(x, f, " ") == 1) && (typeof(f[1]) == "strnum")
11 default:
12 return 0
13 }
14 }