I'm using Igor Pro (I don't use this often). I'm trying to count the number of places to the right of a decimal, if there is one, for one wave. And then add a decimal place however many places to the left, that were in the first wave, to a second wave. For reference I attached a pic of what I currently have. The wave "test_correct" is what it SHOULD look like, and "fix_err" is what I'm currently outputting. I've been at this for awhile but can't seem to figure it out, any help would be appreciated. Thanks example
Function testErrFix()
wave test_energy, test_err
variable i, j, s
variable len = numpnts(test_energy)
make/O/D/N=(len) fix_err
string current_Energy
string current_Err
string Error
variable slen
For(i=0;i<len;i+=1)
current_Energy = num2str(test_energy[i])
current_Err = num2str(test_err[i])
slen = strlen(current_energy)
Error = ""
For(j=0;j<slen;j+=1)
If(Stringmatch(current_Energy[j], ".")==1)
For(s=j;s<slen;s+=1)
Error += "." + current_Err[s-4] + current_Err[s-3] + current_Err[s-2]
EndFor
ElseIf(Stringmatch(current_Energy[j], "")==1)
Error += current_Err[s+1]
For(s=j;s<slen;s+=1)
Error = current_Err[s]
EndFor
EndIf
EndFor
fix_err[i] = str2num(Error)
EndFor
End