Fixed the format_amount filter to deal with negative numbers with decimals correctly.
This commit is contained in:
parent
9d5fce2752
commit
14b871b57a
@ -35,7 +35,7 @@ def format_amount(value: Decimal | None) -> str:
|
|||||||
return "-"
|
return "-"
|
||||||
whole: int = int(value)
|
whole: int = int(value)
|
||||||
frac: Decimal = (value - whole).normalize()
|
frac: Decimal = (value - whole).normalize()
|
||||||
return "{:,}".format(whole) + str(frac)[1:]
|
return "{:,}".format(whole) + str(abs(frac))[1:]
|
||||||
|
|
||||||
|
|
||||||
def format_date(value: date) -> str:
|
def format_date(value: date) -> str:
|
||||||
|
Loading…
Reference in New Issue
Block a user