Android Question fraction of dbutils limited?

MbedAndroid

Active Member
Licensed User
Longtime User
using DBUtils.DB_REAL i found that the fractionpart is very limited.
for test i putted in 123.45678901, got back 123.457, checked it with SQlite viewer, got the same when i read it back from the database

Is there a way to extent the digits to at least 7?
i'm saving GPS positions into the dabase and 3 digits are really too low for use

Saving the position as text give me the full fraction of 7 digits

created the table as following
Dim m As Map
m.Initialize
m.Put("Id", DBUtils.DB_INTEGER)
m.Put("SpotName", DBUtils.DB_TEXT)
m.Put("Date", DBUtils.DB_INTEGER)
m.Put("Time", DBUtils.DB_INTEGER)
m.Put("Latitude", DBUtils.DB_REAL)
m.Put("Longitude", DBUtils.DB_REAL)

DBUtils.CreateTable(SQL1, "spots", m, "Id")
 

MbedAndroid

Active Member
Licensed User
Longtime User
w92xafnah
B4X:
        Dim ListOfMaps As List
                    ListOfMaps.Initialize
                    Dim m As Map
                    m.Initialize
                    m.Put("Id", SearchNewId)
                    m.Put("SpotName", ResourceStrings.Get("NEWSPOT"))
                    m.Put("Date",DateTime.Date(DateTime.Now))
                    m.Put("Time", DateTime.Time(DateTime.Now) )
                    m.Put("Latitude",NumberFormat(Point.Latitude,1,7))
                    m.Put("Longitude",NumberFormat(Point.Longitude,1,7))
                    m.Put("test",123.456789012)
                    ListOfMaps.Add(m)
                    DBUtils.InsertMaps(files.SQL1, "spots", ListOfMaps)

result in sqlite viewer:
the "test" field was DBUtils.REAL type

Screenshot_2015_09_16_12_12_49.png
[/url] hebergeur image[/IMG] [/url][/IMG]
 
Last edited:
Upvote 0

MbedAndroid

Active Member
Licensed User
Longtime User
didnt noticed that discussion , but you might be right
anyway as textstring it works fine, testing outerlimits as -179.9999999 and 89.0000001 are well presented using DBUtils.Text
 
Upvote 0
Top