Skip to content

Commit

Permalink
Make thousand separator notation works with py35 too
Browse files Browse the repository at this point in the history
  • Loading branch information
osantana committed Apr 25, 2017
1 parent 34ed270 commit d51d6b2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion correios/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit d51d6b2

Please sign in to comment.