def _get_locale(self, tp): space = self.space if tp == "n": dec, thousands, grouping = rlocale.numeric_formatting() elif self._thousands_sep: dec = "." thousands = "," grouping = "\3\0" else: dec = "." thousands = "" grouping = "\256" if self.is_unicode: self._loc_dec = dec.decode("ascii") self._loc_thousands = thousands.decode("ascii") else: self._loc_dec = dec self._loc_thousands = thousands self._loc_grouping = grouping
def test_numeric_formatting(): dec, th, grouping = numeric_formatting() assert isinstance(dec, str) assert isinstance(th, str) assert isinstance(grouping, str)