Rob87 Posted March 23, 2023 Share Posted March 23, 2023 Hi there! I need a node which converts strings 'str' into real numbers 'n', to use them with math nodes. Because only digit strings can be converted, there should be two outputs: First output = n -> number if successfully converted Second output = sF -> the original string if it could not be converted F.e.: Input 'hObj': [0] = 1 - TYPE: <class 'str'> [1] = 2 - TYPE: <class 'str'> [2] = 31 - TYPE: <class 'str'> [3] = 1e - TYPE: <class 'str'> Output 'n': [0] = 1.0 - TYPE: <class 'float'> [1] = 2.0 - TYPE: <class 'float'> [2] = 31.0 - TYPE: <class 'float'> Output 'sF' [0] = 1e - TYPE: <class 'str'> Can anybody help me out? That would be awesome! Thank you! Quote Link to comment
Kazumasa Kihara Posted March 24, 2023 Share Posted March 24, 2023 @Rob87 Try this network. 1 Quote Link to comment
Rob87 Posted March 24, 2023 Author Share Posted March 24, 2023 Oh wow, that easy... Hadn't thought of the "is numeric" node. Note to myself: Learn nodes like you learn Spanish vocabulary. Muchas gracias! Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.