def fortfloat(text: str) -> float:
    """Convert Fortran-style float to python float."""
    text = text.strip()
    if text.endswith("d"):
        text = text[:-1]
    text.replace("d", "e")
    try:
        return float(text)
    except ValueError:
        if len(text) > 1 and "-" in text[1:]:
            text = f"{text[0]}{text[1:].replace('-', 'e-')}"
            return float(text)
        else:
            raise