def asNumber(v):
  """Answers the value interpreted as a value or None otherwise.

  >>> asNumber('123')
  123
  >>> asNumber('123.4')
  123.4
  >>> asNumber(123.4)
  123.4
  >>> asNumber('123a')
  0
  """
  try:
    number = float(v)
    if number == int(number):
      return int(number)
    return number
  except ValueError:
    return 0