Skip to content

Commit

Permalink
Merge pull request #70 from hokus15/devel
Browse files Browse the repository at this point in the history
fix(cantidad): Return cantidad with only 2 decimal values for all tipos
  • Loading branch information
hokus15 authored Jan 26, 2025
2 parents 498c79f + d219db0 commit b91491b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion arrendatools/actualiza_renta/tipos/irav.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@ def calcular(
) -> dict:
self.validar_datos(cantidad, dato, mes, anyo_inicial, anyo_final)
try:
cantidad = Decimal(cantidad) # Convertir explícitamente a Decimal
# Convertir explícitamente a Decimal y redondear a dos decimales
cantidad = Decimal(cantidad).quantize(
Decimal("0.01"), rounding=ROUND_HALF_UP
)
tasa_variacion = self._obtener_IRAV(anyo_inicial, mes)
if tasa_variacion is None or tasa_variacion.is_nan():
raise ValueError(
Expand Down

0 comments on commit b91491b

Please sign in to comment.