String to number?
-
Follow-up question now that I have serial communication figured out. Is there a function available to parse a string into a float? I can't find anything in the help docs.
-
@mdturnerphys As far as I know, there is no such fbd because TO_REAL does not handle string
-
@mdturnerphys
To add to what @tomas_hora said, string parsing in general has to be done via ASCII lookups unfortunately.
-
@mdturnerphys Thanks for popping up the topic. TO_REAL function will be able to parse string to float in the upcoming release
-
I started creating my own function to do it named "string_to_real" and then got an error saying that the function already existed. It does show up in the autocomplete list, and I can build a project using it, but it doesn't appear to work.
EDIT: It looks like it only works for single-character strings. "2" gets converted to 2, but "23" gets converted to 0.
-
@mdturnerphys
I am aware of the function, but as you saw it is not quite up to the task. It should work much more robustly in the next Mervis release, but we unfortunately do not have a firm release date yet.
-
Just thought I'd check for updates on this. Thanks.
-
Hi @matt
I believe the latest version of Mervis should be able to handle it better now; you can give it a go and see if it works properly with multi-character strings. For further information please get in touch with [email protected] and/or Martin Kudláček instead, as I will be leaving unipi shortly.