def validate_number(number_str, a, b):
  """
  return float(number_str) if number_str is a number and is in the range [a, b],
  otherwise return None
  """
  try:
    n = float(number_str)
    if a <= n <= b:
      return n
    else: return None

  except ValueError:
    return None