Public Function NumeroDecimales(ByVal dNumber As Double) As Long
On Error GoTo error
Dim Value As String
Dim PosSymb As String
Dim DecSymb As String
Dim NumDecs As Long
DecSymb = Mid(1 / 2, 2, 1)
Value = CStr(dNumber)
PosSymb = InStr(Value, DecSymb)
If CLng(PosSymb) > 0 Then
NumDecs = Len(Value) - CLng(PosSymb)
Else
NumDecs = 0
End If
NumeroDecimales = NumDecs
Exit Function
error:
NumeroDecimales = 0
MsgBox Err.number & ": " & Err.Description
End Function
Suscribirse a:
Enviar comentarios (Atom)
VBA Access. Redondeo de números decimales con el método medio redondeo. Alternativa a la función Round (bankers round)
Private Function Redondeo(ByVal Numero As Variant, ByVal Decimales As Integer) As Double 'Aplica método medio redondeo (half round ...
-
Option Compare Database Option Explicit '***************************** ' 'Ejemplo de uso ' 'selecciona 1 ficher...
-
Option Compare Database Option Explicit 'Zip / UnZip file or folder 'http://www.codekabinett.com/rdumps.php?Lang=2&targetDoc...
No hay comentarios:
Publicar un comentario