From d51d6b28abc517aa6a4b47501807d73a1b25a6c9 Mon Sep 17 00:00:00 2001 From: Osvaldo Santana Neto Date: Tue, 25 Apr 2017 14:01:43 -0300 Subject: [PATCH] Make thousand separator notation works with py35 too --- correios/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/correios/utils.py b/correios/utils.py index 340429c..9a325ff 100644 --- a/correios/utils.py +++ b/correios/utils.py @@ -77,7 +77,7 @@ def to_decimal(value: Union[str, float], precision=2): real, imag = value.rsplit(".", 1) else: real, imag = value, "0" - real = re.sub("[,.]", "", real) + real = re.sub("[,._]", "", real) quantize = Decimal("0." + "0" * precision) return Decimal("{}.{}".format(real, imag)).quantize(quantize)