Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Present Accounting Data #3542
When analyzing accounting or production-related data it is common practice to show larger integer numbers and monetary amounts with separators after every three digits. In an application based on the SQLite library this would be the duty of the application to present data nicely.
I understand that SQLiteStudio is a frontend and not a business apllication. Fortunately, there is the function editor. I have created two funtions to present large integers (frmInt) and monetary amounts (frmAmt) which are shown in two further posts.
I have to say I have difficulties using named arguments. Could somebody please show me a working example of named argument function? Then the width of the presentation field could be supplied and varying.
When using frmInt() and frmAmt() it is useful to change the character font for database results to a fixed width font such as "Lucida Sans Typewriter" or similar. A query such as "SELECT Company, Year, frmInt(COUNT(*)) AS LineItems, frmAmt(SUM(amount)) AS TotalAmount FROM datatable GROUP BY Company, Year;" can look like this:
Do you like that?
Best regards, Jörg
Currently named arguments are not visible under their names in the function implementation code. There is ehancement planned to maka it work this way: #3272
But before that happens you need to handle parameters the usual way. For QtScript it's arguments array, for Tcl it's argv and argc variables, for SQL implementation lang it's $1, $2, and so on.
Functions are now added to the list on https://github.com/pawelsalawa/sqlitestudio/wiki/Scripts_repository
Please let me know if decriptions are okay.
Great. Thanks. I have two remarks: