FracFormatter¶
-
FracFormatter(symbol='', number=1)[source]¶ Returns a
FuncFormatterthat formats numbers as fractions or multiples of some value, e.g. a physical constant.This is powered by the python builtin
Fractionclass. We account for floating point errors using thelimit_denominatormethod.- Parameters
symbol (str) – The symbol, e.g.
r'$\pi$'. Default is''.number (float) – The value, e.g.
numpy.pi. Default is1.