Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (Destination As Any, Source As Any, ByVal Length As Long)Private Type Int64 Lo As Long Hi As Long End TypePrivate Function MyHex(ByVal Value As Double) As String Dim c As Currency Dim i64 As Int64
c = Value / 10000
CopyMemory i64, c, 8
If i64.Hi Then MyHex = Hex(i64.Hi) & Right("0000000" & Hex(i64.Lo), 8) Else MyHex = Hex(i64.Lo) End If
End FunctionPrivate Sub Command1_Click() MsgBox MyHex(187647123874968#)
很急。
Lo As Long
Hi As Long
End TypePrivate Function MyHex(ByVal Value As Double) As String
Dim c As Currency
Dim i64 As Int64
c = Value / 10000
CopyMemory i64, c, 8
If i64.Hi Then
MyHex = Hex(i64.Hi) & Right("0000000" & Hex(i64.Lo), 8)
Else
MyHex = Hex(i64.Lo)
End If
End FunctionPrivate Sub Command1_Click()
MsgBox MyHex(187647123874968#)
End Sub
2147483647是32位的最大值