24.04.2024, 13:51
(24.04.2024, 12:50)tomnord Wrote: Hello. I have a float value, with formatting 00.00. I need to separate the value at '.' . and on the other end, I need to merge them again.
Example: value read from GA= 12.02, values in script: val1=12 and val2= 02
Possible?
Code:
value = grp.getvalue('57/0/1')
--Split by dot
tab = string.split(value, ".")
log(tab)
--Merge into 2byte
if #tab >1 then
grp.update('57/0/2', tab[1] .. '.' .. tab[2])
else
grp.update('57/0/2', tab[1])
end