src/lib/edit.c
bool is_a_number(const char *n)
{
   bool digit_seen = false;

   if (n == NULL) {
      return false;
   }

   if( *n == '-' || *n == '+' ) {
      n++;
   }
   while (B_ISDIGIT(*n)) {
      digit_seen = true;
      n++;
   }
   if (digit_seen && *n == '.') {
      n++;
      while (B_ISDIGIT(*n)) { n++; }
   }
   if (digit_seen && (*n == 'e' || *n == 'E')
       && (B_ISDIGIT(n[1]) || ((n[1]=='-' || n[1] == '+') && B_ISDIGIT(n[2])))) {
      n += 2;                         /* skip e- or e+ or e digit */
      while (B_ISDIGIT(*n)) { n++; }
   }
   return digit_seen && *n==0;
}
/*
 * Check if specified string is a number or not.
 *  Taken from SQLite, cool, thanks.
 */
Check if specified string is a number or not.
Taken from SQLite, cool, thanks.
Check if specified string is a number or not . Taken from SQLite cool thanks .
bool is_a_number(const char *n)
{
   bool digit_seen = false;
   if (n == NULL) {
      return false;
   }
   if( *n == '-' || *n == '+' ) {
      n++;
   }
   while (B_ISDIGIT(*n)) {
      digit_seen = true;
      n++;
   }
   if (digit_seen && *n == '.') {
      n++;
      while (B_ISDIGIT(*n)) { n++; }
   }
   if (digit_seen && (*n == 'e' || *n == 'E')
       && (B_ISDIGIT(n[1]) || ((n[1]=='-' || n[1] == '+') && B_ISDIGIT(n[2])))) {
      n += 2;                         
      while (B_ISDIGIT(*n)) { n++; }
   }
   return digit_seen && *n==0;
}
bool is_a_number ( const char * n ) { bool digit_seen = false ; if ( n == NULL ) { return false ; } if ( * n == ' ' || * n == ' ' ) { n ++ ; } while ( B_ISDIGIT ( * n ) ) { digit_seen = true ; n ++ ; } if ( digit_seen && * n == ' ' ) { n ++ ; while ( B_ISDIGIT ( * n ) ) { n ++ ; } } if ( digit_seen && ( * n == ' ' || * n == ' ' ) && ( B_ISDIGIT ( n [ 1 ] ) || ( ( n [ 1 ] == ' ' || n [ 1 ] == ' ' ) && B_ISDIGIT ( n [ 2 ] ) ) ) ) { n += 2 ; while ( B_ISDIGIT ( * n ) ) { n ++ ; } } return digit_seen && * n == 0 ; }
Check if specified string is a number or not.
Check if specified string is a number or not .
/* skip e- or e+ or e digit */