To use the node in your project you should have the danya/stringtonumber library installed. Use the “File → Add Library” menu item in XOD IDE if you don’t have it yet. See Using libraries for more info.
C++ implementation
struct State {
};
{{ GENERATED_CODE }}
void evaluate(Context ctx) {
auto xString = getValue<input_IN1>(ctx);
bool dot = getValue<input_IN2>(ctx);
int N = length(xString) + 1;
int f = 0;
int s = 0;
int t = 0;
int l = 0;
Number ix = 0;
Number i = 0;
char x[N];
for(int i=0;i<N;i++)
x[i]=0;
dump(xString, x);
char d[sizeof(x)];
for(char* a=x, *b=d; *a; ++a, ++b, ++ix){
while(*a=='.') ++a;
*b=*a;
}
if (!dot){
dump(xString, d);
} else {
if (atof(x) != floor(atof(x))){
N = N-1;
}
}
if(N==2){
l = d[0];
}
if(N==3){
l = d[1];
t = d[0];
}
if(N==4){
l = d[2];
t = d[1];
s = d[0];
}
if(N==5){
l = d[3];
t = d[2];
s = d[1];
f = d[0];
}
emitValue<output_OUT1>(ctx, f-48);
emitValue<output_OUT2>(ctx, s-48);
emitValue<output_OUT3>(ctx, t-48);
emitValue<output_OUT4>(ctx, l-48);
}