24.11.2020, 10:29
(24.11.2020, 09:56)admin Wrote: There were some errors in the script, this should work:
Code:<?
require('apps')
setdlheader('text/csv; charset=utf-8', 'Consumption', 'csv')
csv = {}
objects = grp.tag('consumption')
for _, obj in ipairs(objects) do
csv[ #csv + 1 ] = obj.name .. ',' .. tostring(obj.value)
end
print(table.concat(csv, '\n'))
FANTASTIC ADMIN!! THANK YOU VERY MUCH.
I would like only to clerify a thing.
string.gsub(tostring(obj.value), ".", ",")
With this above I would like to replace dot with comma in the number. I do not know why but he replace all the number with ",". Hence 23.88 became ,,,,,
What is the reason?
Thanks.