Parse a formatted amount string like '1,100.00' into a float.
(value: str)
| 110 | |
| 111 | |
| 112 | def parse_amount(value: str) -> float | None: |
| 113 | """Parse a formatted amount string like '1,100.00' into a float.""" |
| 114 | if value is None: |
| 115 | return None |
| 116 | try: |
| 117 | return float(str(value).replace(",", "").strip()) |
| 118 | except (ValueError, TypeError): |
| 119 | return None |
| 120 | |
| 121 | |
| 122 | def amounts_match(gt_val: str, agent_val: str, tolerance: float) -> bool: |
no outgoing calls
no test coverage detected