Cast string to number

is there any form to cast a string to number???

There’s no such node yet. Although it should be relatively easy to do if you wrap the standard C++ atof into a new C++ node.

And how can this solution look like?

hi, try these, it is an adaptation of another node, I do not remember what it is at this moment.

string-number.xodball (5.6 KB)

string-number

1 Like

/ws/sketchbook/5d914d9e5dc2d6404ab6d6e7dcc35cc5f96591fd2c332bcdeddba880f5f83d35/sketch/sketch.ino:976:10: fatal error: ‘Wire.h’ file not found
#include <Wire.h>
^~~~~~~~
1 error generated.
shared:ERROR: ‘/ws/arduino_data/packages/xod/tools/emscripten/1.39.2/bin/clang++ -target wasm32-unknown-emscripten -D__EMSCRIPTEN_major__=1 -D__EMSCRIPTEN_minor__=39 -D__EMSCRIPTEN_tiny__=1 -D_LIBCPP_ABI_VERSION=2 -Dunix -D__unix -D__unix__ -Werror=implicit-function-declaration -Xclang -nostdsysteminc -Xclang -isystem/ws/arduino_data/packages/xod/tools/emscripten/1.39.2/emscripten/system/include/libcxx -Xclang -isystem/ws/arduino_data/packages/xod/tools/emscripten/1.39.2/emscripten/system/lib/libcxxabi/include -Xclang -isystem/ws/arduino_data/packages/xod/tools/emscripten/1.39.2/emscripten/system/include/compat -Xclang -isystem/ws/arduino_data/packages/xod/tools/emscripten/1.39.2/emscripten/system/include -Xclang -isystem/ws/arduino_data/packages/xod/tools/emscripten/1.39.2/emscripten/system/include/libc -Xclang -isystem/ws/arduino_data/packages/xod/tools/emscripten/1.39.2/emscripten/system/lib/libc/musl/arch/emscripten -Xclang -isystem/ws/arduino_data/packages/xod/tools/emscripten/1.39.2/emscripten/system/local/include -DLLVM_ROOT=/ws/arduino_data/packages/xod/tools/emscripten/1.39.2/bin -DARDUINO_WASM_SIMULATION -DARDUINO_ARCH_WASM -O2 -std=c++11 -nostdlib -fno-exceptions -fno-rtti -c -I/tmp/arduino-sketch-C388920ED63DAAF6FD0C59448BA7F158/sketch -I/ws/arduino_data/packages/xod/hardware/wasm/0.2.0/cores/simulation -I/ws/arduino_data/packages/xod/hardware/wasm/0.2.0/variants/simulation -DEMSCRIPTEN /tmp/arduino-sketch-C388920ED63DAAF6FD0C59448BA7F158/sketch/sketch.ino.cpp -Xclang -isystem/ws/arduino_data/packages/xod/tools/emscripten/1.39.2/emscripten/system/include/SDL -c -o /dev/null -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr’ failed (1)

The generated C++ code contains errors. It can be due to a bad node implementation
or if your board is not compatible with XOD runtime code. The original compiler error
message is above. Fix C++ errors to continue. If you believe it is a bug, report the
problem to XOD developers.

No use simulation, use upload to board