[kmymoney] [Bug 473322] SLQLite "kmmSplits"."sharesFormatted" Data Corrupt perhaps??
JAH
bugzilla_noreply at kde.org
Mon Aug 14 18:28:41 BST 2023
https://bugs.kde.org/show_bug.cgi?id=473322
--- Comment #8 from JAH <vanquestor at gmail.com> ---
>>"I'll see if it's reasonable to add a checkbox to toggle the use of the commas" -
That would be great if possible because as you say, I don't believe they have
any place in a numerical field. Surely it's more properly the program's job to
the formatting
>>Are you sure there is no function in sql to parse a number from a string that does have thousands separators?
They can indeed be parsed out but it makes for unnecessarily messy code.
>>...process that file to read numbers with the thousands separator?
Yes but I'm not just reading & copying data, I need to perform calculations
which is where the commas interfere.
>>Are you depending on the number of decimal places output, or just depending that there are enough to not lose information?
Enough to be accurate to 2 decimal in the result but that sometimes requires
more places in the price
... have you thought about using the unformatted version? .... in the form of
"x/y"
That is my current choice but here is an example of the in (sqlite) sql code to
parse one value stored as a fraction:
((CAST(substr ("kmmSplits"."shares", 1, (instr ("kmmSplits"."shares", '/' ) - 1
) ) AS REAL ) ) / (CAST( substr( "kmmSplits"."shares", ( instr(
"kmmSplits"."shares", '/' ) + 1 ), LENGTH( "kmmSplits"."shares" )) AS REAL )))
I sometimes want to multiply several values whilst adding and subtracting
others .
Thanks to your fix, in future it can be replaced with
"kmmSplits"."valueFormatted" but that will have to be
REPLACE("kmmSplits"."valueFormatted",',','')) if it contains commas. Hence my
request.
--
You are receiving this mail because:
You are the assignee for the bug.
More information about the KMyMoney-devel
mailing list