Attribute VB_Name = "Txtnum"
Public ky As KeyCodeConstants
Public txt As TextBox

Public Sub numchk(txt, ky)
    Dim a
    If ky > 47 And ky < 58 Or ky = 8 Or ky = 13 Or ky = 46 Then
        'nothing
    Else
        ky = 0
    End If
    If ky = 46 Then
        a = InStr(txt.Text, ".")
        If a > 0 Then
            ky = 0
        End If
    End If
End Sub

Public Sub numchk1(txt, ky)
    Dim a
    If ky > 47 And ky < 58 Or ky = 8 Or ky = 13 Then
        'nothing
    Else
        ky = 0
    End If
    If ky = 46 Then
        Beep
    End If
End Sub

Public Function Raund(st1 As String) As String
    Dim st2, st3
    st2 = InStr(st1, ".")
    If st2 > 1 Then
        st3 = Mid(st1, st2 + 1, Len(st1))
        st3 = Format(st3, "00")
        If Val(st3) >= 50 Then
            st1 = Replace(st1, st3, "00")
            st1 = Val(st1) + 1
        Else
            st1 = Replace(st1, st3, "00")
        End If
        Raund = Format(st1, "#.00")
        Exit Function
    End If
    Raund = st1
End Function

