Skip to main content

How does one convert the numeric value obtained from user INPUT to STRING data type?

Thanks

Hi Asuku,

To convert a value to a string, you should use $STR(val).  This will use the currently defined FORMAT keyword, so if you want to convert to an integer, double, or scientific notation, you will need to use the FORMAT before $STR(val).

Likewise, if you want to convert a string to a numeric value, you can use either SVAL(str$) or LVAL(str$) (SVAL will use a period as a decimal separator while LVAL will use the locally defined character as the decimal separator).


Reply