Hey,
I need a function to find the number of decimal places of a certain number (in this specific case doubles)
The first solution would be something like this:
But i feel there is likely a much better way of doing this...any help would be appreciated!!
I need a function to find the number of decimal places of a certain number (in this specific case doubles)
The first solution would be something like this:
Code:
'returns the number of decimal places within a double
Public Function getDecPlaces(inputNum As Double) As Long
Dim ndx As Long
ndx = InStr(1, inputNum, ".")
If ndx > 0 Then
getDecPlaces = Len$(CStr(inputNum)) - ndx
End If
End Function
But i feel there is likely a much better way of doing this...any help would be appreciated!!