- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
if cur == 'EUR':
alldata['total'] = alldata['total'] * Decimal(58)
alldata['cost'] = alldata['cost'] * Decimal(58)
elif cur == 'USD':
alldata['total'] = alldata['total'] * Decimal(62)
alldata['cost'] = alldata['cost'] * Decimal(62)
elif cur == 'GBP':
alldata['total'] = alldata['total'] * Decimal(71)
alldata['cost'] = alldata['cost'] * Decimal(71)
elif cur == 'UAH':
alldata['total'] = alldata['total'] * Decimal(2)
alldata['cost'] = alldata['cost'] * Decimal(2)
ПроÑтой конвертер валют Ñвоими руками!
💩-💩 и в продакшен!!!
SemaReal 02.11.2017 00:53 # +2
Stallman 02.11.2017 01:06 # 0
SemaReal 02.11.2017 01:14 # 0
inkanus-gray 02.11.2017 02:15 # 0
SemaReal 02.11.2017 02:38 # +2
inho 02.11.2017 19:21 # 0
syoma 30.12.2017 11:50 # 0
farmspam 02.11.2017 01:18 # 0
_ cur = alldata.pop('currency', 'RUR')
_ if cur == 'EUR':
_ alldata['total'] = alldata['total'] * Decimal(58)
_ alldata['cost'] = alldata['cost'] * Decimal(58)
_ elif cur == 'USD':
_ alldata['total'] = alldata['total'] * Decimal(62)
_ alldata['cost'] = alldata['cost'] * Decimal(62)
_ elif cur == 'GBP':
_ alldata['total'] = alldata['total'] * Decimal(71)
_ alldata['cost'] = alldata['cost'] * Decimal(71)
_ elif cur == 'UAH':
_ alldata['total'] = alldata['total'] * Decimal(2)
_ alldata['cost'] = alldata['cost'] * Decimal(2)
_ if cur != 'RUB':
_ alldata['note'] = alldata.get('note', '') + '!!!' + cur
RUR и RUB попутаны
SemaReal 02.11.2017 01:25 # +6
тут тридцатилетний опыт программирования лабораторных работ за девятый класс на BASIC
OCETuHCKuu_nemyx 06.03.2019 01:13 # 0