MCPcopy Index your code
hub / github.com/pymupdf/PyMuPDF / _format_g

Function _format_g

src/__init__.py:445–461  ·  view source on GitHub ↗

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')

Source from the content-addressed store, hash-verified

443# String formatting.
444
445def _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
463format_g = _format_g
464

Callers 15

getDestStrFunction · 0.85
getLinkTextFunction · 0.85
set_colorsMethod · 0.85
updateMethod · 0.85
cre_annotMethod · 0.85
set_tocMethod · 0.85
set_colorsMethod · 0.85
__init__Method · 0.85
_insert_imageMethod · 0.85
_set_pageboxMethod · 0.85
remove_rotationMethod · 0.85
draw_lineMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…