Android Question Help:- Sqlite Printf() and TableView


Well-Known Member
Licensed User
Longtime User

The above thread is more than a year old, so I started a new thread regarding this.

From the above thread I understand that the Printf() was added as a core function in version 3.8.3 of sqlite3.
So any sql queries using Printf() will create a run time error on devices that are pre Lollypop.

For Eg.
SELECT printf("%.2f",Price) As Price  // Returns 20.00

My app will be used on Pre-Lollypop devices too for eg Android 4.4.2
In better words, my app should work on all devices irrespective of the Sqlite versions bundled along with the Android OS.

Anybody here knows a similar function that works on all versions. Or what is the better way to move ahead.

I know that there are functions available on B4A to format numbers.

I use TableView and to load data to TableView I use
TblView.LoadSQLiteDB(Starter.SQL1, cSql, True)

I expect formatted output from the SQL itself to load data to TableView.

Or is there any way by which I can set the format of the Column of a TableView so that I can do SQL query without using Printf() and set the Column formatting of the TableView to the way I want to present the data to the user.

Another question is:- Is there anyway that I can upgrade the Sqlite version to the latest on devices that are running Pre-Lollypop ?

Any advice will be appreciated


Licensed User
Longtime User
Another suggestion:
1.Extract data from the table:
2. Add it to a list as you like to format it using numberformat2
3. Display data in tableview from the list
Upvote 0


Licensed User
Longtime User
Try the attached test program.
I added LoadSQLiteDB3 where you can define a simplified column fromatting.
Attached a small test program with the Table class version 2.18.


    22.5 KB · Views: 148
Upvote 0