#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue May 11 13:45:29 2021

@author: st33v
"""

def strCanBeNumber(x):
  """
  A simple way to check whether a string can be converted to a number datatype

  Parameters
  ----------
  x : The string. Is it numeric?

  Returns
  -------
  bool  True if the string can be cast as numeric

  """
  if type(x) is not str: return False
  try:
    float(x)
  except ValueError:
    return False
  return True

def strCanBeInt(x):
  """
  A simple way to check whether a string can be converted to a integer datatype

  Parameters
  ----------
  x : The string. Can it be cast as an integer?

  Returns
  -------
  bool  True if the string can be cast as an integer

  """
  if type(x) is not str: return False
  try:
    int(x)
  except ValueError:
    return False
  return True
