RecordSet Postgresql

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


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

but way is that

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

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

Dim Rs As RecordSet
Dim SqlStr As String

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

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

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