Generic#
- class astropy.units.format.Generic(*args, **kwargs)[source]#
Bases:
Base
A “generic” format.
The syntax of the format is based directly on the FITS standard, but instead of only supporting the units that FITS knows about, it supports any unit available in the
astropy.units
namespace.Attributes Summary
Methods Summary
format_exponential_notation
(val[, format_spec])Formats a value in exponential notation.
parse
(s[, debug])Convert a string to a unit object.
Attributes Documentation
- name: ClassVar[str] = 'generic'#
Methods Documentation
- classmethod format_exponential_notation(val: float | np.number, format_spec: str = 'g') str [source]#
Formats a value in exponential notation.
- Parameters:
- valnumber
The value to be formatted
- format_spec
python:str
, optional Format used to split up mantissa and exponent
- Returns:
python:str
The value in exponential notation in a this class’s format.