ICultureInfo.IsDouble

Syntax

IsDouble(Value: String): Boolean;

Parameters

Value. Value converted into real type.

Description

The IsDouble method returns whether it is possible to convert into real number according to the current regional parameter settings.

Comments

The method returns True if conversion is available, and False if it is impossible. The ParseDouble or TryParseDouble method can be used for conversion.

Example

Sub UserProc;
Var
    CI: ICultureInfo;
Begin
    CI := CultureInfo.Invariant;
    Debug.WriteLine(CI.IsDouble("123.123"));
    Debug.WriteLine(CI.IsDouble("123,123"));
    Debug.WriteLine(CI.IsDouble("123 123"));
    CI := CultureInfo.CurrentUi;
    Debug.WriteLine(CI.IsDouble("123.123"));
    Debug.WriteLine(CI.IsDouble("123,123"));
    Debug.WriteLine(CI.IsDouble("123 123"));
End Sub UserProc;

On executing the example it will be checked if the specified string values can be converted into real numbers. The check is made according to regional settings of invariant culture and visual interface culture of the current application. The check results will be displayed in the development environment console.

See also:

ICultureInfo