Skip to main content
`Ctrl`+`K`

# Generic

class astropy.units.format.Generic(*args, **kwargs)

  Bases: `Base`, `_GenericParserMixin`

  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

  `name` |

  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 = 'generic'

  Methods Documentation

  classmethod format_exponential_notation(val, format_spec='g')

    Formats a value in exponential notation.

    Parameters:
      val number

        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.

  classmethod parse(s, debug=False)

    Convert a string to a unit object.