How to turn a string into a floating point number in ATS?

68 Views Asked by At

Basically, I am looking for a function of the following type:

fun string2double(rep: string): double

which converts a string representing a floating point number into the number.

For instance, string2double("3.14") should return 3.14.

1

There are 1 best solutions below

0
On

It can be implemented as follows:

fun string2double(x: string): double = g0string2float_double(x)