ConversionToSingle(String, Single) Method

Return a number converted to Single, with no exception thrown in the case that the specified value is not valid.

Definition

Namespace: Html
Assembly: Html (in Html.dll) Version: 25.2822.3845
C#
public static float ToSingle(
	string value,
	float defaultValue
)

Parameters

value  String
Value to convert to a Single.
defaultValue  Single
The default value to return if the value can not be converted.

Return Value

Single
If the caller's value was valid, a Single representation of that value. Otherwise, the caller's specified default value.

See Also