Home »
VB.Net »
VB.Net Programs
VB.Net program to demonstrate the Fix() function
By Nidhi Last Updated : November 11, 2024
Fix() function in VB.Net
The Fix() function is used to get the integer portion from the specified double number.
Syntax
Fix(val)
Parameter(s)
- num: Specified double number.
Return Value
The Fix() function will return the integer portion of the given number.
VB.Net code to demonstrate the example of Fix() function
The source code to demonstrate the Fix() function is given below. The given program is compiled and executed successfully.
'VB.Net program to demonstrate the Fix() function.
Module Module1
Sub Main()
Dim val As Double = 32.53
Dim ret As Double = 0
ret = Fix(val)
Console.WriteLine("Result: {0}", ret)
End Sub
End Module
Output:
Result: 32
Press any key to continue . . .
Explanation:
In the above program, we created a module Module1 that contains a Main() method. In the Main() method, we created two variables val and ret. Here, variable val is initialized with 32.53 and variable ret is initialized with 0.
ret = Fix(val)
In the above code, we used the Fix() function that will return the integer portion of the given number.
Then we printed the character on the console screen.
VB.Net Basic Programs »