add all valutes in rub

This commit is contained in:
Er2 2022-02-16 10:49:40 +03:00
parent 6add3f5e6b
commit 7e26dfa38d

View file

@ -36,6 +36,15 @@ function rub:course(wants)
wants = type(wants) == 'table' and wants or {} wants = type(wants) == 'table' and wants or {}
local r, founds = {}, {} local r, founds = {}, {}
if table.find(wants, 'HELP')
or table.find(wants, 'ALL')
then
for _, v in pairs(resp.Valute) do
table.insert(r, ('%d %s (%s) = %f Руб.'):format(v.Nominal, v.Name, v.CharCode, v.Value:gsub(',', '.')))
end
return r, resp.Date, wants
end
for i = 1, #resp.Valute do for i = 1, #resp.Valute do
local v = resp.Valute[i] local v = resp.Valute[i]
if table.find(wants, v.CharCode) then if table.find(wants, v.CharCode) then