def format_currency(number, lc, LO, CUR): symbol = CURRENCY_SYMBOLS.get(CUR, CUR) c_format = get_currency_format(lc, LO, CUR) formatted_abs = formats.number_format(abs(number)) retval = c_format.replace('ยค', symbol).replace('#', formatted_abs) if number < 0: retval = '-{}'.format(retval) return retval
class _RealWorldCurrencyInput(_BaseMoneyInput): '''it's a class attribute so take care with patching it in tests''' CURRENCY_SYMBOL = CURRENCY_SYMBOLS.get(settings.REAL_WORLD_CURRENCY_CODE, settings.REAL_WORLD_CURRENCY_CODE)