MCPcopy Create free account
hub / github.com/ChartGalaxy/ChartGalaxy / to_float

Function to_float

code_understanding/scoring.py:47–54  ·  view source on GitHub ↗

Converts text to float, stripping percent signs. Returns None on failure.

(text: str)

Source from the content-addressed store, hash-verified

45
46
47def to_float(text: str) -> Optional[float]:
48 """
49 Converts text to float, stripping percent signs. Returns None on failure.
50 """
51 try:
52 return float(text.strip().strip('%'))
53 except ValueError:
54 return None
55
56
57def evaluate_single_answer(

Callers 1

evaluate_single_answerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected