cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 
Starting August 6, 2024, TLS 1.2 will be the minimum required protocol version for Graphisoft products and services that require an online connection. License Manager Tool update is required on Windows. Learn more…
Libraries & objects
About Archicad and BIMcloud libraries, their management and migration, objects and other library parts, etc.

String to Number

Anonymous
Not applicable
If there a function for GDL that turns a string into a number or extracts part of a string to be a number?

Thanks in advance.
4 REPLIES 4
TomWaltz
Participant
Check out STR() in the GDL Reference Manual. It has several uses and variables.
Tom Waltz
Anonymous
Not applicable
This came straight from the Archicad/GDL Help. STR requires a numerical expression and changes it to a string. I'm looking for a Function that turns a String into a Number.

STR (numeric_expression, length, fractions)
STR{2} format_string, numeric_expression [,
exta_accuracy_string])

The first form of the function creates a string from the current value of the numeric expression. The minimum number for numerical characters in the string is length, while fractions represents the numbers following the floating point. If the converted value has more than length characters, it is expanded as required. If it has fewer characters, it is padded on the left (length>0) or on the right (length<0).
Example:

A=4.5
B=2.345
TEXT2 0, 2, STR(A, 8, 2) ! 4.50
TEXT2 0, 1, STR(B, 8, 2) ! 2.34
TEXT2 0, 0, STR(A*B, 8, 2) ! 10.55
TomWaltz
Participant
oh, sorry, that's SPLIT()
Tom Waltz
Anonymous
Not applicable
That worked. Thanks.