RecordSet Postgresql

Two different RecordSet with the same table and it read
RecordSet one read 1.5514999389648437e+2
RecordSet two read 155.15000000000001

way

yes, and those values are the same, just with different display + rounding.

but way is that
gg1=Rs.IdxField(x).StringValue
gg2=RsClone.IdxField(x).StringValue

It’s still the same value.
Compare the two double values & you’ll find they are very very close.

FWIW IF this is for representing money I would avoid DOUBLES.
Use either currency or simply scale an int64 by 100,000 (so you have fractional values to several decimal places).
Or use Bob Delaneys plugins that give you precise numerical types that let you do currency type calculations with a great deal of precision.

The reason ?
It’s not long before doubles start to use scientific notation and as soon as that happens you start to lose precision which would be a disaster tracking financial data

Hi Norman (representing money I would avoid DOUBLES)
But i have problems when i use
Dim g1 as currency
g1=Val(TxtPrice.text)

so how i do this or how fix

Dim v As Variant = TxtPrice.text
g1 = v.CurrencyValue

if i use data type on postgresql money
then return
Dim Db As New DatabaseRecord
Dim dd1,dd2 As Variant
TextField1.Text=“1,234.44”
dd1=TextField1.Text
dd2=TextField1.Text
Db.CurrencyColumn(“price1”)=dd1.CurrencyValue
Db.DoubleColumn(“price2”)=dd2.CurrencyValue

Dim Rs As RecordSet
Dim SqlStr As String

SqlStr=“Select * From mymath”
Rs=DbConn.SQLSelect(SqlStr)
If DbConn.Error Then
exit Sub
End If

Label1.Text=Str(Rs.Field(“price1”).CurrencyValue) <<< return 1 and no 1,234.44
Label2.Text=Str(Rs.Field(“price2”).CurrencyValue)

hi i found the problem if the number is 12,334.03 it save on db like 12 but if i save like 12334.03 works fine