(_val)
| 282 | val: Any, precision: Optional[int] = None, round_digits: bool = False |
| 283 | ) -> str: |
| 284 | def _format(_val): |
| 285 | if isinstance(_val, float) and precision: |
| 286 | if round_digits: |
| 287 | return round(_val, precision) |
| 288 | return _normalize_float(_val, precision) |
| 289 | if isinstance(_val, abc.Mapping): |
| 290 | return {k: _format(v) for k, v in _val.items()} |
| 291 | if isinstance(_val, list): |
| 292 | return [_format(x) for x in _val] |
| 293 | return _val |
| 294 | |
| 295 | return str(_format(val)) |
| 296 |
no test coverage detected