3.5.7.41 Value

Description

This function converts a string number to double. It is a more limited version of Origin C's atof() function and is provided for compatibility with Excel.

Syntax

double Value(string str$)

Parameters

str

is the string that you want to convert to double.

Return

Return the double value that has been converted to double. From Origin2019, percent is also supported.

Example

string str1$ = "+.50";
double dstr1 = Value(str1$);
dstr1 = ;//should be "0.5"
string str2$ = "50%";
double dstr2 = Value(str2$);
dstr2 = ;//should be "0.5"
value("2k")=;//2000
value("1,071")=;//1071