ooodev.format.proto.calc.numbers.numbers_t module

protocol ooodev.format.proto.calc.numbers.numbers_t.NumbersT[source]

Bases: StyleT, Protocol

Numbers Protocol

Classes that implement this protocol must have the following methods / attributes:

__init__(num_format=Ellipsis, num_format_index=Ellipsis, lang_locale=Ellipsis, component=Ellipsis)[source]

Constructor

Parameters:
  • num_format (NumberFormatEnum, int, optional) – Type of a number format. Use this to select a default format. Defaults to 0 (General Format). Only used if num_format_index is -1 (omitted).

  • num_format_index (NumberFormatIndexEnum, int, optional) – Index of a number format. The enumeration values represent the built-in number formats. Defaults to -1.

  • lang_locale (Locale, optional) – Locale of the number format. Defaults to None which used current Locale.

  • component (XComponent, optional) – Document such as Spreadsheet or Chart. If Omitted, the current document is used. Defaults to None.

Return type:

None

classmethod from_index(index, lang_locale=None, **kwargs)[source]

Gets instance from number format index. This is the index that is assigned to the NumberFormat property of an object such as a cell.

Parameters:
  • index (int) – Format (NumberFormat) index.

  • lang_locale (Locale, optional) – Locale. Defaults to None.

Keyword Arguments:

component (XComponent) – Calc document. Default is current document.

Returns:

Instance that represents numbers format.

Return type:

Numbers

from_obj(obj: Any) NumbersT
from_obj(obj: Any, **kwargs) NumbersT
from_obj(**kwds)

Helper for @overload to raise when called.

classmethod from_str(nf_str, lang_locale=None, auto_add=False, **kwargs)[source]

Gets instance from format string

Parameters:
  • nf_str (str) – Format string.

  • lang_locale (Locale, optional) – Locale. Defaults to None.

  • auto_add (bool, optional) – If True, format string will be added to document if not found. Defaults to False.

Keyword Arguments:

component (XComponent) – Calc document. Default is current document.

Returns:

Instance that represents numbers format.

Return type:

Numbers

__protocol_attrs__ = {'add_event_listener', 'add_event_observer', 'apply', 'backup', 'boolean', 'copy', 'currency', 'date', 'datetime', 'fraction', 'from_index', 'from_obj', 'from_str', 'general', 'get_attrs', 'get_props', 'get_update_obj', 'has_update_obj', 'number', 'on_applied', 'on_applying', 'on_property_backed_up', 'on_property_backing_up', 'on_property_restore_set', 'on_property_restore_setting', 'on_property_set', 'on_property_set_error', 'percent', 'prop_format_key', 'prop_format_kind', 'prop_format_str', 'prop_has_attribs', 'prop_has_backup', 'prop_parent', 'remove_event_listener', 'remove_event_observer', 'restore', 'scientific', 'set_update_obj', 'support_service', 'text', 'time', 'update'}
property boolean: Self

Gets boolean format

Return type:

Self

property currency: Self

Gets currency format

Return type:

Self

property date: Self

Gets date format

Return type:

Self

property datetime: Self

Gets datetime format

Return type:

Self

property fraction: Self

Gets fraction format

Return type:

Self

property general: Self

Gets general format

Return type:

Self

property number: Self

Gets number format

Return type:

Self

property percent: Self

Gets percent format

Return type:

Self

property prop_format_key: int

Gets the format key

Return type:

int

property prop_format_str: str

Gets the format string, e.g. #,##0.00

Return type:

str

property scientific: Self

Gets scientific format

Return type:

Self

property text: Self

Gets text format

Return type:

Self

property time: Self

Gets time format

Return type:

Self