Fix in moneyfield
This commit is contained in:
parent
dff9269695
commit
7838cc48ae
1 changed files with 3 additions and 3 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
from paramecio.cromosoma.corefields import FloatField
|
from paramecio.cromosoma.corefields import FloatField
|
||||||
from decimal import Decimal, getcontext
|
from decimal import Decimal, getcontext
|
||||||
from locale import format
|
from locale import format_string
|
||||||
|
|
||||||
getcontext().prec=2
|
getcontext().prec=2
|
||||||
|
|
||||||
|
|
@ -18,9 +18,9 @@ class MoneyField(FloatField):
|
||||||
|
|
||||||
def show_formatted(self, value):
|
def show_formatted(self, value):
|
||||||
|
|
||||||
return format('%.2f', Decimal(value), grouping=True)
|
return format_string('%.2f', Decimal(value), grouping=True)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def format_money(value):
|
def format_money(value):
|
||||||
return format('%.2f', Decimal(value), grouping=True)
|
return format_string('%.2f', Decimal(value), grouping=True)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue