SciFormatter

class SciFormatter(precision=None, zerotrim=None)[source]

Bases: Formatter

Format numbers with scientific notation.

Parameters:
  • precision (int, default: {6, 2}) – The maximum number of digits after the decimal point. Default is 6 when zerotrim is True and 2 otherwise.

  • zerotrim (bool, default: rc['formatter.zerotrim'] = True) – Whether to trim trailing decimal zeros.

Methods Summary

__call__(x[, pos])

Convert number to a string.

Methods Documentation

__call__(x, pos=None)[source]

Convert number to a string.

Parameters:
  • x (float) – The value.

  • pos (float, optional) – The position.