Seis casas decimais para estes campos: "ICMS (%)", "ICMS (%) (UF/Ref)", "Dif. ICMS (pp)", "PIS (%)", "COFINS (%)", "Consumo (kWh)"
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -507,12 +507,12 @@ async def export_excel(
|
|||||||
with pd.ExcelWriter(output, engine="xlsxwriter") as writer:
|
with pd.ExcelWriter(output, engine="xlsxwriter") as writer:
|
||||||
df.to_excel(writer, index=False, sheet_name="Relatório")
|
df.to_excel(writer, index=False, sheet_name="Relatório")
|
||||||
|
|
||||||
# aplica formatação 4 casas decimais
|
# aplica formatação 6 casas decimais
|
||||||
wb = writer.book
|
wb = writer.book
|
||||||
ws = writer.sheets["Relatório"]
|
ws = writer.sheets["Relatório"]
|
||||||
fmt_4dec = wb.add_format({"num_format": "0.0000"})
|
fmt_4dec = wb.add_format({"num_format": "0.000000"})
|
||||||
|
|
||||||
for col in ["ICMS (%)", "ICMS (%) (UF/Ref)", "Dif. ICMS (pp)", "PIS (%)", "COFINS (%)"]:
|
for col in ["ICMS (%)", "ICMS (%) (UF/Ref)", "Dif. ICMS (pp)", "PIS (%)", "COFINS (%)", "Consumo (kWh)"]:
|
||||||
if col in df.columns:
|
if col in df.columns:
|
||||||
i = df.columns.get_loc(col)
|
i = df.columns.get_loc(col)
|
||||||
# largura automática básica + formato; ajuste a largura se quiser (ex.: 12)
|
# largura automática básica + formato; ajuste a largura se quiser (ex.: 12)
|
||||||
|
|||||||
@@ -7,4 +7,5 @@ python-multipart==0.0.6
|
|||||||
openpyxl==3.1.2
|
openpyxl==3.1.2
|
||||||
pandas==2.2.2
|
pandas==2.2.2
|
||||||
PyMuPDF==1.22.5
|
PyMuPDF==1.22.5
|
||||||
httpx==0.27.0
|
httpx==0.27.0
|
||||||
|
xlsxwriter==3.2.0
|
||||||
Reference in New Issue
Block a user