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

This commit is contained in:
2025-08-13 23:10:11 -03:00
parent 5a9fb44bdb
commit f6c8943d4e
2 changed files with 5 additions and 4 deletions

View File

@@ -507,12 +507,12 @@ async def export_excel(
with pd.ExcelWriter(output, engine="xlsxwriter") as writer:
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
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:
i = df.columns.get_loc(col)
# largura automática básica + formato; ajuste a largura se quiser (ex.: 12)