dotposition

danya/stringtonumber/dotposition

No description
dotposition
@/dotposition
INnumber
dotposition
IN
OUT1
OUT2
OUT3
OUT4
OUT4number
OUT3boolean
OUT2boolean
OUT1boolean
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 inValue = getValue<input_IN>(ctx);
    //emitValue<output_OUT>(ctx, inValue);
   Number a = (floor(getValue<input_IN>(ctx)*1000)/1000);
    int b = floor(a);
    int f;
    int s;
    int l;
    int bdot = 0;// i = b
   
    if (a == (ceil(a*1000)/1000)){
       bdot = 3;
    }
     if (a == (ceil(a*100)/100)){
       bdot = 2;
    }
     if (a == (ceil(a*10)/10)){
        bdot = 1;
    }
     if (a == ceil(a)){
        bdot = 0;
    }
    
    if (a != b){
        
        
        if (floor(bdot) == 3){
           f = 1;
           s = 0;
           l = 0;
         
      }
          if (floor(bdot) == 2){
           f = 0;
           s = 1;
           l = 0;
             
      }
          if (floor(bdot) == 1){
           f = 0;
           s = 0;
           l = 1;
          
      }
         
    } 
    else {
           f = 0;
           s = 0;
           l = 0;
    
         }
      
    emitValue<output_OUT1>(ctx, f);
    emitValue<output_OUT2>(ctx, s);
    emitValue<output_OUT3>(ctx, l);
    emitValue<output_OUT4>(ctx, bdot);
}