Double.TryParse(InputValue,0) explanation

I am unable to understand what that (0) stands for within double.TryParse brackets.
This is from academy

Thank you in advance

@Vidya_Srinivasan - its a signature of the
Double.TryParse(input string , output double).

pls refer below link

3 Likes

This doesn’t answer it for me. Perhaps you can elaborate. The .NET link you provided specifies that the second argument (double) TryParse(String, Double) has to be variable and gives out an error when set to 0.

TryParse only verifies if the input is a valid string containing double value. A TRUE means it is valid and FALSE means otherwise.
For example,
var_double double

double.TryParse( “12.34”, var_double) will return TRUE
double.TryParse( “12.34a”, var_double) will return FALSE

After evaluating the outcome you should then do the actual “parse” to get the value. Thus, if
strVAlue=“12.34” then the following code evaluates if the outcome is true and if yes, then converts the string value into double and stores it into a double variable. If false, then it prints a message:

if double.TryParse( strValue, var_double ) then (…do the parse)
var_double = double.Parse(strValue)
write line (strVAlue+" IS a double. var_double = “+var_double.ToString)
else
write line (strVAlue+” is NOT a double")

Hope this helps.