Skip to content
drewmccluskey edited this page Nov 28, 2018 · 7 revisions

real

Transforms a string into a real number.

Syntax:

real(str);

Argument

  • str

Description

  • Character string to be converted.

Returns: Real number

Description:

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.

Example:

//any event
val = real(5 + 5);

Sets the variable val to 10.

Example 2:

//any event
str = “One 2str = 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

Clone this wiki locally