-
-
Notifications
You must be signed in to change notification settings - Fork 19
real
drewmccluskey edited this page Nov 28, 2018
·
7 revisions
Transforms a string into a real number.
real(str);Argument
- str
Description
- Character string to be converted.
Returns: Real number
This function is used to change a string into a real number. Mathematical signs may be used within the input string, but letters and non-mathematical symbols may not. If you want to remove any non-accepted characters in a string before using this function, put the string through the string_digits() function to remove all non-numeric characters.
//any event
val = real(“5 + 5”);Sets the variable val to 10.
//any event
str = “One 2”
str = string_digits(str);
str = real(str);The above code will remove the text “One” and then convert the remaining text “2” into a real number; 2.
Back to strings