NCEPLIBS-bufr  12.0.0
digit.f
Go to the documentation of this file.
1 C> @file
2 C> @brief Check whether the characters in a string are all numeric
3 C>
4 C> @author J. Woollen @date 1994-01-06
5 
6 C> This logical function checks whether the characters in a string
7 C> are all numeric.
8 C>
9 C> @param[in] STR -- character*(*): String
10 C> @returns digit -- logical: .TRUE. if all characters in STR are
11 C> numeric; .FALSE. otherwise
12 C>
13 C> @author J. Woollen @date 1994-01-06
14  LOGICAL FUNCTION digit(STR)
15 
16  CHARACTER*(*) str
17  digit = .false.
18  DO i=1,len(str)
19  IF( llt(str(i:i),'0') .OR. lgt(str(i:i),'9') ) GOTO 100
20  ENDDO
21  digit = .true.
22 
23 C EXIT
24 C ----
25 
26 100 RETURN
27  END
logical function digit(STR)
This logical function checks whether the characters in a string are all numeric.
Definition: digit.f:15