Skip to content

Commit

Permalink
Formatando com separador de milhar os numeros
Browse files Browse the repository at this point in the history
  • Loading branch information
danimaribeiro committed Oct 5, 2023
1 parent 2801635 commit 849fcec
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion pytrustnfe/nfe/danfe.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from io import BytesIO
from textwrap import wrap
import math
from decimal import Decimal

from reportlab.lib import utils
from reportlab.pdfgen import canvas
Expand Down Expand Up @@ -84,7 +85,8 @@ def getdateByTimezone(cDateUTC, timezone=None):

def format_number(cNumber):
if cNumber:
return cNumber.replace(",", "X").replace("X", ".").replace(".", ",")
cNumber = "{0:,}".format(Decimal(cNumber))
return cNumber.replace(",", "X").replace(".", ",").replace("X", ".")
return ""


Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from setuptools import setup, find_packages


VERSION = "2.0.0"
VERSION = "2.0.1"


setup(
Expand Down

0 comments on commit 849fcec

Please sign in to comment.