[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
How to test whether a string is a valid number?
From: |
Peng Yu |
Subject: |
How to test whether a string is a valid number? |
Date: |
Mon, 7 Sep 2020 19:00:42 -0500 |
Hi,
I want to know whether a string is a valid number. But it seems typeof
is not appropriate for it? Is there something available in awk that
can tell whether a string is a valid number? Thanks.
$ awk -v x=5 -e 'BEGIN { print typeof(3.5),typeof(x) }'
number strnum
--
Regards,
Peng
- How to test whether a string is a valid number?,
Peng Yu <=