- Function fmtminute(n)
- On Error Resume Next
- Dim d, h , m, s, t
- If Not IsNumeric(n) Then
- fmtminute = ""
- Exit Function
- End If
- d = n \ (24 * 60) '取整数部分得到天
- h = (n - d * (24 * 60)) \ 60 '取整数部分得到小时
- m = n - d * (24 * 60) - h * 60 '减天减时得到分钟数
- ' s = n Mod 60
- t = ""
- If d > 0 Then t = t & d & "天"
- If t <> "" Or h > 0 Then t = t & h & "小时"
- If t <> "" Or m > 0 Then t = t & m & "分钟"
- ' t = t & s & "秒"
- fmtminute = t
- End Function
复制代码
|