Bug 315864 - Add built-in support for money (decimal) data type
Summary: Add built-in support for money (decimal) data type
Status: CONFIRMED
Alias: None
Product: KEXI
Classification: Applications
Component: Tables (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR wishlist
Target Milestone: ---
Assignee: Kexi Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-02-27 18:52 UTC by Friedrich W. H. Kossebau
Modified: 2020-08-20 14:12 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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