MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / _format_approx

Function _format_approx

lib/matplotlib/cbook.py:2313–2318  ·  view source on GitHub ↗

Format the number with at most the number of decimals given as precision. Remove trailing zeros and possibly the decimal point.

(number, precision)

Source from the content-addressed store, hash-verified

2311
2312
2313def _format_approx(number, precision):
2314 """
2315 Format the number with at most the number of decimals given as precision.
2316 Remove trailing zeros and possibly the decimal point.
2317 """
2318 return f'{number:.{precision}f}'.rstrip('0').rstrip('.') or '0'
2319
2320
2321def _g_sig_digits(value, delta):

Callers 1

transformMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…