| MvValueAsFloat Method |
Converts to float.
Namespace:
RW.Server.Component
Assembly:
RW.Server.Component (in RW.Server.Component.dll) Version: 7.2.0.0 (7.2.0.0)
Syntax public virtual float AsFloat(
bool direct = false,
float def = 0f
)
Public Overridable Function AsFloat (
Optional direct As Boolean = false,
Optional def As Single = 0F
) As Single
public:
virtual float AsFloat(
bool direct = false,
float def = 0f
)
Parameters
- direct (Optional)
- Type: SystemBoolean
If true, an exact type match is required. - def (Optional)
- Type: SystemSingle
The default result.
Return Value
Type:
Single
If the match is exact, the contained value. Otherwise, and if
an exact type match is not required:
If the type is user-defined, the result of
AsUserValue.AsFloat(def). If the type is numeric (including
char), the
value converted to
float. If the type is bool,
1.0 if true,
0.0 if false. if the type is
String, try to parse it as a
float.
See Also