cs_ghuysmans99
Messages postés3982Date d'inscriptionjeudi 14 juillet 2005StatutMembreDernière intervention30 juin 201316 24 févr. 2010 à 21:55
Y'a plus simple (code à vérifier mais il devrait fonctionner) :
Public Function UnpackNum(theAmt As String) As Double
Dim thelast As String, theFrnt As String
thelast = Right(Trim(theAmt), 1)
theFrnt = Mid$(theAmt, 1, Len(theAmt) - 1) If thelast "{" Or thelast "}" Then thelast = "0"
If Asc(thelast) > 73 And Asc(thelast) < 83 Then thelast = Chr(Asc(thelast) - 25)
If Asc(thelast) > 64 And Asc(thelast) < 74 Then thelast = Chr(Asc(thelast) - 16)
UnpackNum = Val(theFrnt & thelast) / 100 If thelast "}" Or (Asc(thelast) > 73 And Asc(thelast) < 83) Then UnpackNum -UnpackNum
End Function
Adn56
Messages postés1172Date d'inscriptionjeudi 24 mai 2007StatutMembreDernière intervention28 septembre 20131 24 févr. 2010 à 18:41
24 févr. 2010 à 21:55
Public Function UnpackNum(theAmt As String) As Double
Dim thelast As String, theFrnt As String
thelast = Right(Trim(theAmt), 1)
theFrnt = Mid$(theAmt, 1, Len(theAmt) - 1) If thelast "{" Or thelast "}" Then thelast = "0"
If Asc(thelast) > 73 And Asc(thelast) < 83 Then thelast = Chr(Asc(thelast) - 25)
If Asc(thelast) > 64 And Asc(thelast) < 74 Then thelast = Chr(Asc(thelast) - 16)
UnpackNum = Val(theFrnt & thelast) / 100 If thelast "}" Or (Asc(thelast) > 73 And Asc(thelast) < 83) Then UnpackNum -UnpackNum
End Function
24 févr. 2010 à 18:41