Function O2T(ByVal Value As Double, Optional ByVal ValueType As Byte = 0, Optional ByVal ValueFinal As Byte = 2) As Double
O2T = Value * 1024 ^ (CInt(ValueType) - ValueFinal)
End Function
' Un petit exemple
Sub Command1_Click()
'Convertion de la taille d'un fichier : Octet -> Mega-Octet
MsgBox O2T(FileLen("C:\Fichier.txt"), 1, 2)
MsgBox O2T(1024, 0, 1) 'Retourne 1
End Sub