Bug 494159 - Wrong decimal separator in CSV import
Summary: Wrong decimal separator in CSV import
Status: RESOLVED FIXED
Alias: None
Product: skrooge
Classification: Applications
Component: general (show other bugs)
Version: 2.33.0
Platform: Debian testing Linux
: NOR normal
Target Milestone: 25.1.0
Assignee: pat_h
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-10-05 08:35 UTC by pat_h
Modified: 2024-10-12 16:04 UTC (History)
0 users

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


Attachments
Example for group separator (919 bytes, text/csv)
2024-10-06 16:15 UTC, pat_h
Details

Note You need to log in before you can comment on or make changes to this bug.
Description pat_h 2024-10-05 08:35:39 UTC
Hi,

with a German bank, the CSV export uses comma as a decimal separator and a point as a digit group separator (https://en.wikipedia.org/wiki/Decimal_separator#Digit_grouping). However, for integer values, the bank does not include the fractional part in the CSV output resulting in something like "1.234" for 1234 €. This, however, is imported by Skrooge as a fraction resulting in 1.23 € (i.e. a euro and 23 cent).

I see at least four possibilities how this can be solved
1. Argue with the bank to avoid using a point as a group separator as this is against the standards (https://en.wikipedia.org/wiki/Decimal_separator#Current_standards). I'll try that, but this is unlikely to change anything (we are talking about Germany here, where more than 25 years after introducing ISO 8601 via DIN EN 28601 kids still do not learn in school how to write a date correctly).
2. Use the decimal and group separators from the current locale when doing the CSV import in Skrooge.
3. Have an option to change the decimal and group separators when doing the CSV import in Skrooge.
4. Interpret the point as a group separator if there are three trailing digits.
Comment 1 Stephane MANKOWSKI 2024-10-06 12:05:45 UTC
Hi,

Could you provide me a sample csv file anonymized ?
This is just to be sure I well take into account the right use case.
Comment 2 pat_h 2024-10-06 16:15:16 UTC
Created attachment 174481 [details]
Example for group separator
Comment 3 pat_h 2024-10-06 16:20:30 UTC
Thanks for taking a look. I prepared a file with some lines deleted where only examples of relevant amounts and their formatting are included.

I can't comment in #494197 as it is already closed, therefore I'll state it here: Thank you very much for implementing the "checking" functionality and in addition doing it in such a short time! I really appreciate that!
Comment 4 Stephane MANKOWSKI 2024-10-12 16:04:48 UTC
Git commit 459a500b74fd03b315ffef2d3d86e3192b888b60 by Stephane MANKOWSKI.
Committed on 12/10/2024 at 16:04.
Pushed by smankowski into branch 'master'.

Wrong decimal separator in CSV import

M  +1    -0    CHANGELOG
M  +19   -17   skgbasemodeler/skgservices.cpp
A  +6    -0    tests/input/skgtestimportcsv/494159.csv
M  +15   -15   tests/input/skgtestimportcsvunit/test2.csv
M  +28   -3    tests/skgbankmodelertest/skgtestimportcsv.cpp
M  +6    -0    tests/skgbasemodelertest/skgtestbase.cpp

https://invent.kde.org/office/skrooge/-/commit/459a500b74fd03b315ffef2d3d86e3192b888b60