MCPcopy Create free account
hub / github.com/scanny/python-pptx / numeric_str_val

Method numeric_str_val

src/pptx/chart/data.py:586–596  ·  view source on GitHub ↗

The string representation of the numeric (or date) label of this category, suitable for use in the XML `c:pt` element for this category. The optional *date_1904* parameter specifies the epoch used for calculating Excel date numbers.

(self, date_1904=False)

Source from the content-addressed store, hash-verified

584 return self._label if self._label is not None else ""
585
586 def numeric_str_val(self, date_1904=False):
587 """
588 The string representation of the numeric (or date) label of this
589 category, suitable for use in the XML `c:pt` element for this
590 category. The optional *date_1904* parameter specifies the epoch used
591 for calculating Excel date numbers.
592 """
593 label = self._label
594 if isinstance(label, (datetime.date, datetime.datetime)):
595 return "%.1f" % self._excel_date_number(date_1904)
596 return str(self._label)
597
598 @property
599 def sub_categories(self):

Callers 2

_cat_num_pt_xmlMethod · 0.80

Calls 1

_excel_date_numberMethod · 0.95

Tested by 1