Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -141,7 +141,7 @@ def buscar_combinacoes_rapido(credito_desejado, entrada_desejada, parcela_deseja
|
|
| 141 |
return f"❌ Erro inesperado: {str(e)}"
|
| 142 |
|
| 143 |
def formatar_resultados(resultados):
|
| 144 |
-
"""Formata os resultados para exibição com layout
|
| 145 |
if not resultados or isinstance(resultados, str):
|
| 146 |
return resultados
|
| 147 |
|
|
@@ -163,31 +163,26 @@ def formatar_resultados(resultados):
|
|
| 163 |
taxa_percentual = (taxa_total / credito_real) * 100 if credito_real > 0 else 0
|
| 164 |
taxa_mensal = taxa_percentual / maior_prazo if maior_prazo > 0 else 0
|
| 165 |
|
| 166 |
-
#
|
| 167 |
resposta += f"""
|
| 168 |
-
|
| 169 |
|
| 170 |
-
|
|
|
|
| 171 |
|
| 172 |
-
🏦
|
| 173 |
-
📅
|
| 174 |
-
💳
|
|
|
|
|
|
|
|
|
|
|
|
|
| 175 |
|
| 176 |
-
|
| 177 |
-
📊 **Taxa Mensal:** {taxa_mensal:.2f}%
|
| 178 |
-
📈 **Taxa Anual:** {taxa_mensal * 12:.2f}%
|
| 179 |
-
🔢 **Código:** {', '.join(codigos)}
|
| 180 |
-
|
| 181 |
-
---
|
| 182 |
-
|
| 183 |
-
🔍 **Ver mais detalhes** ▼
|
| 184 |
|
| 185 |
🎯 **Valor Final:** {formatar_moeda(valor_final)}
|
| 186 |
💎 **Crédito Líquido:** {formatar_moeda(credito_real)}
|
| 187 |
-
⚡ **Taxa Total:** {taxa_percentual:.2f}% ({formatar_moeda(taxa_total)})
|
| 188 |
-
|
| 189 |
-
---
|
| 190 |
-
|
| 191 |
"""
|
| 192 |
except Exception as e:
|
| 193 |
print(f"⚠️ Erro ao formatar resultado: {e}")
|
|
|
|
| 141 |
return f"❌ Erro inesperado: {str(e)}"
|
| 142 |
|
| 143 |
def formatar_resultados(resultados):
|
| 144 |
+
"""Formata os resultados para exibição com layout IDÊNTICO ao de Automóvel."""
|
| 145 |
if not resultados or isinstance(resultados, str):
|
| 146 |
return resultados
|
| 147 |
|
|
|
|
| 163 |
taxa_percentual = (taxa_total / credito_real) * 100 if credito_real > 0 else 0
|
| 164 |
taxa_mensal = taxa_percentual / maior_prazo if maior_prazo > 0 else 0
|
| 165 |
|
| 166 |
+
# FORMATAÇÃO IDÊNTICA AO CARD DE AUTOMÓVEL
|
| 167 |
resposta += f"""
|
| 168 |
+
{adm} - Imóvel
|
| 169 |
|
| 170 |
+
Crédito
|
| 171 |
+
{formatar_moeda(total_credito)}
|
| 172 |
|
| 173 |
+
🏦 Entrada: {formatar_moeda(total_entrada)}
|
| 174 |
+
📅 Prazo: {maior_prazo} meses
|
| 175 |
+
💳 Parcela: {formatar_moeda(total_parcelas)}
|
| 176 |
+
📉 Saldo Devedor: {formatar_moeda(total_saldo)}
|
| 177 |
+
📊 Taxa Mensal: {taxa_mensal:.2f}%
|
| 178 |
+
📈 Taxa Anual: {taxa_mensal * 12:.2f}%
|
| 179 |
+
🔢 Código: {', '.join(codigos)}
|
| 180 |
|
| 181 |
+
🔍 Ver mais detalhes ▼
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 182 |
|
| 183 |
🎯 **Valor Final:** {formatar_moeda(valor_final)}
|
| 184 |
💎 **Crédito Líquido:** {formatar_moeda(credito_real)}
|
| 185 |
+
⚡ **Taxa Total:** {taxa_percentual:.2f}% ({formatar_moeda(taxa_total)})
|
|
|
|
|
|
|
|
|
|
| 186 |
"""
|
| 187 |
except Exception as e:
|
| 188 |
print(f"⚠️ Erro ao formatar resultado: {e}")
|