I am retrieving the database value with this statement:
then I am using to the returned value here:
Here is where the issue begins. When I step through it.
dblNominal = 14 and gGetFieldData() is returning 13.8.
My math tells me that 14-13.8 = .2 but the I keep getting a .19999999999999...
The database field is stored as a Number...
Any ideas?
Code:
Public Function gGetFieldData(ByRef dynToUse As Object, ByVal strFieldName As String, ByVal udeDataType As cpcDataType, Optional ByVal udeDataFormat As cpcDataFormat) As Variant
Dim varToReturn As Variant
Select Case udeDataType
Case cpcdouble
If Not IsNull(dynToUse.Fields(strFieldName).value)
Then
'we have an double so use it
varToReturn = CDbl(Val(dynToUse.Fields(strFieldName.value))
Else
'field not used so default to 0
varToReturn = CDbl(0)
End If
Case Else
'if we add more types
End Select
'return the data
gGetFieldData = varToReturn
End Function
then I am using to the returned value here:
Code:
dblMinus = dblNominal - gGetFieldData(dynLimits, "Minimum", cpcdouble)
Here is where the issue begins. When I step through it.
dblNominal = 14 and gGetFieldData() is returning 13.8.
My math tells me that 14-13.8 = .2 but the I keep getting a .19999999999999...
The database field is stored as a Number...
Any ideas?