Exemple #1
0
def currency(value):
    """
    Format value as a currency.
    """
    return h.format_decimal(Decimal(value).quantize(Decimal(".01"), ROUND_HALF_UP))
Exemple #2
0
 def _from_python(self, value, state):
     if self.if_empty is not formencode.NoDefault and not value:
         return ''
     return format_decimal(value)