def _parse_and_format_value(string_value):
  """Parses and formats a string into the stats format.

  Args:
    string_value: Value of the stat as string.

  Returns:
    Value of the stat as a float.
  """
  if str(string_value).lower() == 'nan':
    return None

  if type(string_value) == float:
    return string_value

  if type(string_value) == int:
    return float(string_value)

  string_value = str(string_value)

  if '%' in string_value:
    string_value = string_value.replace('%', '')
    return float(string_value) / 100

  return float(string_value)