ooodev.format.calc.direct.cell.numbers package
Module contents
- class ooodev.format.calc.direct.cell.numbers.Numbers(num_format=0, num_format_index=-1, lang_locale=None, component=None)[source]
Bases:
StyleBase
Calc Numbers format.
See also
New in version 0.9.4.
- __init__(num_format=0, num_format_index=-1, lang_locale=None, component=None)[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
- apply(obj: Any)[source]
- apply(obj: Any, **kwargs)
- apply(obj, **kwargs)
Applies styles to object
- Parameters:
obj (object) – UNO Object that styles are to be applied.
kwargs (Any, optional) – Expandable list of key value pairs that may be used in child classes.
- Keyword Arguments:
format_key (Any, optional) – NumberFormat key, overrides
prop_format_key
property value.- Return type:
None
- copy()[source]
- copy(**kwargs)
- copy(**kwargs)
Creates a copy of the instance.
- Returns:
Copy of the instance.
- Return type:
- Parameters:
self (_TNumbers) –
- 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:
- classmethod from_obj(obj)[source]
- classmethod from_obj(obj, **kwargs)
- classmethod from_obj(obj, **kwargs)
Gets instance from object
- Parameters:
obj (object) – UNO Object.
- Keyword Arguments:
component (XComponent) – Calc document. Default is current document.
- Raises:
NotSupportedError – If
obj
is not supported.- Returns:
Instance that represents numbers format.
- Return type:
- 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:
- property boolean: _TNumbers
Gets boolean format
- Return type:
TypeVar
(_TNumbers
, bound= Numbers)
- property currency: _TNumbers
Gets currency format
- Return type:
TypeVar
(_TNumbers
, bound= Numbers)
- property date: _TNumbers
Gets date format
- Return type:
TypeVar
(_TNumbers
, bound= Numbers)
- property datetime: _TNumbers
Gets datetime format
- Return type:
TypeVar
(_TNumbers
, bound= Numbers)
- property fraction: _TNumbers
Gets fraction format
- Return type:
TypeVar
(_TNumbers
, bound= Numbers)
- property general: _TNumbers
Gets general format
- Return type:
TypeVar
(_TNumbers
, bound= Numbers)
- property number: _TNumbers
Gets number format
- Return type:
TypeVar
(_TNumbers
, bound= Numbers)
- property percent: _TNumbers
Gets percent format
- Return type:
TypeVar
(_TNumbers
, bound= Numbers)
- property prop_format_key: int
Gets the format key
- Return type:
int
- property prop_format_kind: FormatKind
Gets the kind of style
- Return type:
- property prop_format_str: str
Gets the format string, e.g.
#,##0.00
- Return type:
str
- property scientific: _TNumbers
Gets scientific format
- Return type:
TypeVar
(_TNumbers
, bound= Numbers)
- property text: _TNumbers
Gets text format
- Return type:
TypeVar
(_TNumbers
, bound= Numbers)
- property time: _TNumbers
Gets time format
- Return type:
TypeVar
(_TNumbers
, bound= Numbers)