示例#1
0
def currency2(dollars):
    try:
        dollars = float(dollars)
    except ValueError:
        return dollars

    # Convert to cents (integer)
    cents = int(dollars * 100)
    return currency_format(cents)
示例#2
0
def currency(cents):
    return currency_format(cents)