Comments (2)
My understanding is that once you apply a printf()
as a Display Format to a column in DB4S, that column in the browser window is no longer REAL, but it is TEXT, hence the rules for text sorting apply. The following example illustrates this using a view:
CREATE TABLE t1 (price REAL);
INSERT INTO t1 (price) VALUES (102.1),(21.2),(1.3),(2.4);
SELECT printf('%.2f', "price") as price
FROM t1
ORDER BY price
;
-- |price |
-- |------|
-- |1.30 |
-- |102.10|
-- |2.40 |
-- |21.20 |
One solution to this problem is to write your own view, and order by the original column:
SELECT printf('%.2f', "price") as price
FROM t1
ORDER BY t1.price
;
-- |price |
-- |------|
-- |1.30 |
-- |2.40 |
-- |21.20 |
-- |102.10|
from sqlitebrowser.
But the type in the database is still REAL. And a view format should not change a type to TEXT. Clicking on the header of the column should still use REAL to sort the column cells. It makes not really sense that just adding a precision of 2 to a REAL value destroy sorting of the values.
from sqlitebrowser.
Related Issues (20)
- Port to Qt 6 HOT 1
- Rewrite Build Entries in the Wiki HOT 1
- Support for Branch-Specific Build Variants HOT 1
- [Bug]: Importing CSV with column headers doesn't work if columns are not in same order as table in DB HOT 1
- Quick Browse HOT 1
- [Feature]: Comment Line Shortcut key for "Execute SQL" tab and Shortcut Key selection screen HOT 3
- [Feature]: auto reopen last database HOT 9
- No data returned from SQL query HOT 2
- [Bug]: Can't run nightly build on macOS 12.7.4 HOT 7
- [Bug]: External drives cannot be opened on Ubuntu HOT 3
- [Bug]: Execute SQL Console overlaps text HOT 2
- [Feature]: Allow NOT operator '!' in front of filters
- [Bug]: Find and Replace fails to replace all finds HOT 1
- [Bug]: Copy/paste results of SQL select hangs / freeze program HOT 1
- [Feature]: Plot - change axis to log scale
- [Bug]: When you start the program, an error message appears. HOT 7
- [Bug]: Unable to open databases with encoding UTF-16le HOT 7
- [Bug] The "File -> Export -> Database to SQL File ..." doesn't export the values in the "sqlite_sequence" table HOT 2
- [Bug]: Program crashes when executing SQL query HOT 2
- [Bug]: crashed HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sqlitebrowser.