Appending currency symbol in CSV import
Currently, when the field currency is set, the symbol get prepended, according to the current documentation currency field:
currency sets a currency symbol, to be prepended to all postings' amounts.
...
There's quite a list of currency symbols that are appended to the amount; e.g. Swiss francs or kronas in scandinavian countries.
It would be useful to have a field currencyAppend or some other name (I have a writer's black and can't find anything elegant) for such cases. One can also introduce currencyPrepend and make the now-active currency a synonym of the latter. Similarly for currencyN, of course.
I agree that this is awkward sometimes. The usual workaround is to use a more elaborate amount assignment, like amount1 %amount_ %currency_ ..
I agree that this is awkward sometimes. The usual workaround is to use a more elaborate amount assignment, like
amount1 %amount_ %currency_..
That's what I do right now, that's indeed awkward.
It would be a bit nonobvious, but: right now we detect and preserve a space after currency's value. We could say that if there's a space before it instead, we will add it on the right (with a space).
It would be a bit nonobvious, but: right now we detect and preserve a space after
currency's value. We could say that if there's a space before it instead, we will add it on the right (with a space).
So, the .csv.rules file will understand something like this?
currency " EUR"
We don't require the quotes. So currently you can have
currency EUR
giving EUR123
or
currency EUR<SPACE>
giving EUR 123
and we could add support for
currency <SPACE>EUR
giving 123 EUR
We don't require the quotes. So currently you can have
currency EURgiving
EUR123orcurrency EUR<SPACE>
Significant trailing whitespace, that's not something I expected, to be honest. I am more inclined to put quotes to highlight such cases=)
I hear you. Eg currency EUR, currency "EUR ", currency " EUR".
We have had some significant whitespace from the beginning (2+ space delimiters in certain places; indentation for postings).
We don't use quotes for anything else in the rules file. Using them just for this would be an inconsistency.
We do use double quotes in journal files, to enclose complex commodity symbols and to give an empty value to commodity and payee directives.
PS I would accept pull requests in this area. The only thing the above wouldn't allow is adding a currency symbol on the right with no separating space.