File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -13926,14 +13926,24 @@ def _transform_passed_failed(
13926
13926
interrogation_performed: bool,
13927
13927
active: list[bool],
13928
13928
locale: str,
13929
+ df_lib=None,
13929
13930
) -> list[str]:
13930
13931
if not interrogation_performed:
13931
13932
return ["" for _ in range(len(n_passed_failed))]
13932
13933
13934
+ # Helper function to format numbers safely
13935
+ def _format_float_safe(value: float) -> str:
13936
+ if df_lib is not None:
13937
+ # Use GT-based formatting to avoid Pandas dependency completely
13938
+ return _format_single_float_with_gt(value, decimals=2, locale=locale, df_lib=df_lib)
13939
+ else:
13940
+ # Fallback to the original behavior
13941
+ return vals.fmt_number(value, decimals=2, locale=locale)[0]
13942
+
13933
13943
passed_failed = [
13934
13944
(
13935
- f"{n_passed_failed[i] if n_passed_failed[i] < 10000 else _fmt_lg(n_passed_failed[i], locale=locale)}"
13936
- f"<br />{vals.fmt_number (f_passed_failed[i], decimals=2, locale=locale)[0] }"
13945
+ f"{n_passed_failed[i] if n_passed_failed[i] < 10000 else _fmt_lg(n_passed_failed[i], locale=locale, df_lib=df_lib )}"
13946
+ f"<br />{_format_float_safe (f_passed_failed[i]) }"
13937
13947
if active[i]
13938
13948
else "—"
13939
13949
)
You can’t perform that action at this time.
0 commit comments