-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug: CSV number formats are not sanitized/parsed correctly for non-USD currencies #1713
Comments
Same here, I created a custom script to format the amount field from my different banks. It gets the CSV as input, removes thousand "." separator or space, and then changes from "," to "." for the decimal part. Finally the output CSV is the one I'm uploading to Maybe,. But as you said, like it's in the date, will be good to have a format selector for amount |
/bounty $300 |
💎 $300 bounty • MaybeSteps to solve:
Thank you for contributing to maybe-finance/maybe! Add a bounty • Share on socials
|
@zachgoll that's understandable but looks like when the comma is stripped away, it doesn't consider the numbers after the comma to be a part of the amount. Do we already know about this ?Its pretty obvious, |
/attempt #1713 will start looking at this tomorrow and Saturday I already deal with this kind of things when implementing VISA payments so will drop a PR in a couple of days Options |
/attempt #1713
|
Currently, we're using a naive sanitization function to deal with CSV import
amount
string values that have non-numeric characters in them.maybe/app/models/import.rb
Lines 146 to 149 in d2a7aef
This causes problems with a CSV where the currency is say,
EUR
, and the delimiter/separator are reverse of our assumed USD case:The CSV above will NOT be imported correctly since the
,
will be stripped away and it will become125454
Instead, we should be asking the user for:
Based on these options, the CSV import should default to the selected currency and sanitize inputs based on the separator/delimiter option, where the possible currencies are found in
config/currencies.yml
and the possible separator/delimiter options are:Fields
We need to add these two fields (currency, format) to the configuration screen for a CSV import:
The text was updated successfully, but these errors were encountered: