There are standard functions such as atof and atoi in C\'s stdlib.h for converting strings to floats / integers (and to do the reverse
atof
atoi
stdlib.h
One can test string is double $x before using $x in expressions.
string is double $x
E.g., [string is double 1.2.3] returns 0
[string is double 1.2.3]