Code:
Public Class Form1
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
End Sub
Public Function RoundDown(ByVal InputValue As Double) As Double
Try
Dim Deci As Long = InStr(1, CStr(InputValue), ".", CompareMethod.Text)
If Deci > 0 Then
Return (CDbl(Mid(CStr(InputValue), 1, Deci)))
Else
Return (InputValue)
End If
Catch
MsgBox(Err.Description, MsgBoxStyle.Information + MsgBoxStyle.OkOnly, "Round Down Error")
End Try
End Function
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
MessageBox.Show(RoundDown(5.71))
End Sub
End Class
Warning 1 Function 'RoundDown' doesn't return a value on all code paths. Are you missing a 'Return' statement? C:\Users\Monkey\AppData\Local\Temporary Projects\WindowsApplication1\Form1.vb 17 5 WindowsApplication1
Not sure what I need to fix here if anything?