DataFunctions.ValidateFloat Method (PIA)
Use this method to check whether a string contains a valid floating-point number, and to optionally check the value of the number against a specified range.
Definition
[Visual Basic .NET]
Imports Microsoft.CommerceServer.Interop
…
Public Function ValidateFloat(vtNumber As Object,
vtMin As Object,
vtMax As Object) As Object
[C#]
using Microsoft.CommerceServer.Interop;
…
public object ValidateFloat(objectvtNumber,
objectvtMin,
objectvtMax);
Parameters
[Visual Basic .NET]
- vtNumber
An Object that contains the floating-point number to validate. - vtMin
An Object that contains a value specifying the low end of the range. The default value for this parameter is Null, which means that the vtMin parameter is ignored in the range validation. - vtMax
An Object that contains a value specifying the high end of the range. The default value for this parameter is Null, which means that the vtMax parameter is ignored in the range validation.
[C#]
- vtNumber
An object that contains the floating-point number to validate. - vtMin
An object that contains a value specifying the low end of the range. The default value for this parameter is null, which means that the vtMin parameter is ignored in the range validation. - vtMax
An object that contains a value specifying the high end of the range. The default value for this parameter is null, which means that the vtMax parameter is ignored in the range validation.
Return Values
[Visual Basic .NET] If this method completes successfully, it returns a Boolean Object that indicates whether the vtNumber parameter is valid. A value of True indicates the vtNumber parameter is a valid floating-point number, and that it is within the given range, if any.
[C#] This method returns an object containing a bool that indicates whether the vtNumber parameter is valid. A value of true indicates the vtNumber parameter is a valid floating-point number, and that it is within the given range, if any.
Exceptions
This method may throw one of many mapped exceptions or an exception of type COMException. See Standard COM Errors for additional details.
Example
[Visual Basic .NET]
Dim Result As Object
Dim Amount As Object
DataFunctions df = New DataFunctions()
' Set Locale to USA
myLocale = 1033
myFloat = 12.33
df.Locale = myLocale
Result = df.ValidateFloat(myFloat, 1, 10)
Response.Write(myFloat & " Is this float between 1 & 10?: " & " " _
& Result & "<P>")
myFloat = 2.33
Result = df.ValidateFloat(myFloat, 1, 10)
Response.Write(myFloat & " Is this float between 1 & 10?: " & " " _
& Result & "<P>")
[C#]
No example available.
Requirements
Namespace: Microsoft.CommerceServer.Interop
Platforms: Windows 2000, Windows Server 2003
Assembly: mscsasphelplib (in mscsasphelplib.dll)
See Also
DataFunctions.ConvertFloatString
Copyright © 2005 Microsoft Corporation.
All rights reserved.