Based on old C1Report code, used to convert any object to double, see function's source code for details. Returns true if conversion successfull, false otherwise.
シンタックス
'宣言
Public Shared Function TryCastNumber( _
ByVal As System.Object, _
ByVal As System.Globalization.CultureInfo, _
ByVal As System.Boolean, _
ByRef As System.Double _
) As System.Boolean
'使用法
Dim o As System.Object
Dim cultureInfo As System.Globalization.CultureInfo
Dim nullAsZero As System.Boolean
Dim value As System.Double
Dim value As System.Boolean
value = Utils.TryCastNumber(o, cultureInfo, nullAsZero, value)
public static System.bool TryCastNumber(
System.object ,
System.Globalization.CultureInfo ,
System.bool ,
out System.double
)
パラメータ
- o
- Object to convert.
- cultureInfo
- System.Globalization.CultureInfo used for conversion.
- nullAsZero
- Convert null or System.DBNull.Value to zero and return true, otherwise false will be returned.
- value
- OUT: double value.
参照