Bug 315864

Summary: Add built-in support for money (decimal) data type
Product: [Applications] KEXI Reporter: Friedrich W. H. Kossebau <kossebau>
Component: TablesAssignee: Kexi Bugs <kexi-bugs>
Status: CONFIRMED ---    
Severity: wishlist CC: staniek
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Friedrich W. H. Kossebau 2013-02-27 18:52:18 UTC
Some people are storing financial data in dbs. FP of course do not cut it, due to rounding errors on roundtrips.

The built-in datatypes in Kexi could include a data type "financial data" and then internally map to whatever makes sense in the backend. E.g. Postgres is said to use decimal or numeric.

Spreadsheet programs have an own datatype for that as well, so makes also sense to align with them.

Requested on #kexi, when wanting to design tables matching those in http://bazaar.launchpad.net/~rladams/+junk/TERTqt/view/head:/lib/SQLTxns.py
4 flat tables, 3 columns each (id, name, note):
1 table of filenames, (id, file, note, rotate, scale)
1 table of reports, (id, internal, submitted, paid)
1 table postings (a piece of a txn), amount, txn_id, account_id, project_id, category_id (so mostly links to the other tables)
1 txn table (date, payee, file_id)

Reproducible: Always
Comment 1 Jarosław Staniek 2016-11-04 12:18:37 UTC
Row values could be used with SQLite 3.15: http://sqlite.org/rowvalue.html
They have correct comparison operators too. I have not checked compatibility with other backends.

So we can have (dollars, cents) pair for example.

BTW, Other use of that would be for date/time values.
Comment 2 Jarosław Staniek 2020-08-20 14:12:06 UTC
New SQLite feature: https://sqlite.org/floatingpoint.html#decext