This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Splitting and merging values
#2
(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
Should work...
Reply


Messages In This Thread
Splitting and merging values - by tomnord - 24.04.2024, 12:50
RE: Splitting and merging values - by fleeceable - 24.04.2024, 13:51
RE: Splitting and merging values - by tomnord - 25.04.2024, 06:02
RE: Splitting and merging values - by admin - 25.04.2024, 06:37

Forum Jump: