code: public static function n($value = null)
      {
          while (is_array($value)) {
              $value = array_shift($value);
          }
  
          switch (gettype($value)) {
              case 'double':
              case 'float':
              case 'integer':
                  return $value;
              case 'boolean':
                  return (int) $value;
              case 'string':
                  //    Errors
                  if ((strlen($value) > 0) && ($value[0] == '#')) {
                      return $value;
                  }
  
                  break;
          }
  
          return 0;
      }
docs: N.
  
  Returns a value converted to a number
  
  @param null|mixed $value The value you want converted
  
  @return number N converts values listed in the following table
  If value is or refers to N returns
  A number            That number
  A date                The serial number of that date
  TRUE                1
  FALSE                0
  An error value        The error value
  Anything else        0