add all valutes in rub

This commit is contained in:
Er2 2022-02-16 10:49:40 +03:00
parent 6add3f5e6b
commit 7e26dfa38d
1 changed files with 9 additions and 0 deletions

View File

@ -36,6 +36,15 @@ function rub:course(wants)
wants = type(wants) == 'table' and wants or {}
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
local v = resp.Valute[i]
if table.find(wants, v.CharCode) then