def _cap_str_to_mln_float(cap: str):
    """If cap = 'n/a' return 0, else:
       - strip off leading '$',
       - if 'M' in cap value, strip it off and return value as float,
       - if 'B', strip it off and multiple by 1,000 and return
         value as float"""
    if cap == "n/a":
        return 0

    capital = cap.lstrip("$")

    if capital[-1] == "M":
        return float(capital.replace("M", ""))

    if capital[-1] == "B":
        return float(capital.replace("B", "")) * 1000