Bases: Formatter
Format numbers by retaining the specified number of significant digits.
sigfig (float
, default: 3
) – The number of significant digits.
zerotrim (bool
, default: rc['format.zerotrim']
) – Whether to trim trailing decimal zeros.
base (float
, default: 1
) – The base unit for rounding. For example SigFigFormatter(2, base=5)
rounds to the nearest 5 with up to 2 digits (e.g., 87 –> 85, 8.7 –> 8.5).
Methods Summary
__call__
(x[, pos])
Convert number to a string.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4