Attribute VB_Name = "CommonFunc"
Public Function FillZero(ByVal N As Long, ByVal nDigit As Integer) As String
    Dim s As String
    s = CStr(N)
    If Len(s) > nDigit Then
        s = Left(s, nDigit)
    Else
        Do While Len(s) < nDigit
            s = "0" + s
        Loop
    End If
    FillZero = s
End Function

Public Function ToRealPrice(ByVal N As Long, ByVal Digit As Integer) As Single
    Dim s As String
    Dim base As Long
    
    base = 10 ^ Digit
    
    s = CStr(N \ base) & "." & FillZero(Abs(N) Mod base, Digit)
    ToRealPrice = CSng(s)
End Function

Public Function FormatTime(ByVal T As Long) As String
    If T = 0 Then
        FormatTime = ""
    Else
        Dim s As String
        FormatTime = FillZero(T, 6)
    End If
End Function
