Every month I export my transactions from my Dutch bank as an xls sheet.
When I load this xls sheet into LibreOffice, the amounts are displayed as “220.90”
I wrote a macro to change the format to “€ 220.90”, using this code:
oLocalSettings.language = "uk"
oLocalSettings.country = "uk"
oNumberFormats = thiscomponent.numberFormats
lKey = oNumberFormats.queryKey("[$€-413] #,##0.00;[RED]- [$€-413] #,##0.00", oLocalSettings , true)
If lKey = -1 then
lKey = oNumberFormats.addNew("[$€-413] #,##0.00;[RED]- [$€-413] #,##0.00", oLocalSettings)
endif
...
oSheet.getCellByPosition(3,i).NumberFormat = lKey
oSheet.getCellByPosition(3,i).HoriJustify = "3"
It used to work, but after my profile got reset, and I upgraded to 7.4.4.2, it doesn’t work any longer.
Now it displays the values as “€ 220,900.00”.
Obviously it’s getting confused because in Holland “,” is the decimal separator and “.” is the thousands separator, but the original value is using . as the decimal separator, and my locale settings are set to UK:
Locale setting is “Default - English (UK)”
Default currency is “Default - GBP”
Decimal separator key is ticked same as locale setting (.)
I’m not sure if something’s changed in my profile, or in LO.
Can anybody help please?
(by the way if I replace “[$€-413]” with “x” it still changes the format to 220,900.00)
(and manually formatting the data as Euros does not change the format)