ubuntu-buildroot/output/build/host-gawk-5.2.0/awklib/eg/lib/isnumeric.awk

15 lines
284 B
Awk

# isnumeric --- check whether a value is numeric
function isnumeric(x, f)
{
switch (typeof(x)) {
case "strnum":
case "number":
return 1
case "string":
return (split(x, f, " ") == 1) && (typeof(f[1]) == "strnum")
default:
return 0
}
}