remove-dot-from-number

danya/stringtonumber/remove-dot-from-number

No description
remove-dot-from-number
@/remove-dot-from-number
INnumber
remove-dot-from-number
IN
OUT
OUTnumber
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 inputn = getValue<input_IN>(ctx);
Number outputn;
    if (inputn != floor(inputn)){
    for (outputn = (floor(inputn*1000)/1000); (fmod(outputn, 10)) != 0; outputn = (floor(outputn*1000)/100)){
         
      }
        outputn /=10;
    }
    else {
        outputn = inputn;
    }
    
    emitValue<output_OUT>(ctx, outputn);

}