Hi Gang,
Google search gave me nothing, so here it goes:
Is there a better way to find out how many digits there are after decimal point in the given number?
123 => 0
12.56 => 2
3.4 => 1 etc.
Right now I have a little Function that accepts a number and returns another number (of digits after decimal point + 1, this 1 is the decimal point itself)
Private Function MoveNumberBy(sngValue As Single) As Double
If InStr(1, CStr(sngValue), ".") > 0 Then
MoveNumberBy = (Len(CStr(sngValue)) - InStr(1, CStr(sngValue), ".")) + 1
End If
End Function
I hope there is a better way than dealing with converting the number to string and messing with it like that.
---- Andy
Google search gave me nothing, so here it goes:
Is there a better way to find out how many digits there are after decimal point in the given number?
123 => 0
12.56 => 2
3.4 => 1 etc.
Right now I have a little Function that accepts a number and returns another number (of digits after decimal point + 1, this 1 is the decimal point itself)
Private Function MoveNumberBy(sngValue As Single) As Double
If InStr(1, CStr(sngValue), ".") > 0 Then
MoveNumberBy = (Len(CStr(sngValue)) - InStr(1, CStr(sngValue), ".")) + 1
End If
End Function
I hope there is a better way than dealing with converting the number to string and messing with it like that.
---- Andy