Example #1
0
 def _get_locale(self, tp):
     if tp == "n":
         dec, thousands, grouping = rlocale.numeric_formatting()
     elif self._thousands_sep:
         dec = "."
         thousands = ","
         grouping = "\3"
     else:
         dec = "."
         thousands = ""
         grouping = "\xFF"    # special value to mean 'stop'
     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
Example #2
0
 def _get_locale(self, tp):
     if tp == "n":
         dec, thousands, grouping = rlocale.numeric_formatting()
     elif self._thousands_sep:
         dec = "."
         thousands = ","
         grouping = "\3"
     else:
         dec = "."
         thousands = ""
         grouping = "\xFF"  # special value to mean 'stop'
     if self.is_unicode:
         self._loc_dec = rutf8.decode_latin_1(dec)
         self._loc_thousands = rutf8.decode_latin_1(thousands)
     else:
         self._loc_dec = dec
         self._loc_thousands = thousands
     self._loc_grouping = grouping
Example #3
0
 def _get_locale(self, tp):
     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
Example #4
0
def test_numeric_formatting():
    dec, th, grouping = numeric_formatting()
    assert isinstance(dec, str)
    assert isinstance(th, str)
    assert isinstance(grouping, str)
Example #5
0
def test_numeric_formatting():
    dec, th, grouping = numeric_formatting()
    assert isinstance(dec, str)
    assert isinstance(th, str)
    assert isinstance(grouping, str)