Returns `value` formatted with mupdf.fz_format_double() if available, otherwise with Python's `%`. If `value` is a list or tuple, we return a space-separated string of formatted values.
(value, *, fmt='%g')
| 443 | # String formatting. |
| 444 | |
| 445 | def _format_g(value, *, fmt='%g'): |
| 446 | ''' |
| 447 | Returns `value` formatted with mupdf.fz_format_double() if available, |
| 448 | otherwise with Python's `%`. |
| 449 | |
| 450 | If `value` is a list or tuple, we return a space-separated string of |
| 451 | formatted values. |
| 452 | ''' |
| 453 | if isinstance(value, (list, tuple)): |
| 454 | ret = '' |
| 455 | for v in value: |
| 456 | if ret: |
| 457 | ret += ' ' |
| 458 | ret += _format_g(v, fmt=fmt) |
| 459 | return ret |
| 460 | else: |
| 461 | return mupdf.fz_format_double(fmt, value) |
| 462 | |
| 463 | format_g = _format_g |
| 464 |
no outgoing calls
no test coverage detected
searching dependent graphs…