Beispiel #1
0
def format_int_amount(number, request):
    if number is None:
        return ''
    number = float(number)/100
    if round(number) == number:
        return '%d' % int(number)
    else:
        fnumber = Decimal('%.2f' % number)
        return fdec(fnumber, format='#,##0.00', locale=get_locale(request))
Beispiel #2
0
def format_number(number, request):
    if number is None or number=="": return ""
    fnumber = Decimal('%.2f' % number)
    return fdec(fnumber, format='#,##0.##;-#', locale=get_locale(request))
Beispiel #3
0
def format_int_amount(number, locale = 'en'):
    if number is None:
        return ''
    fnumber = Decimal('%.2f' % number)
    return fdec(fnumber, format='#,##0', locale=locale)