Hi,

I've recently updated to 2.7 and since then the total revenue in the exported file is messed up, also for older months. The average order column shows correct amount.

For instance at admin/store/reports/sales/year the tottal revenue for March would show €9.999,99 then in the exported CSV it would show 9999.99485

I've noticed that online 848 of uc_reports.admin.inc the uc_price() function has been removed which would round amounts to two decimals. Is this by error?

Cheers

Comments

longwave’s picture

This was deliberately changed in #630058: CSV should have only figures, without any formatting so the reports are more accurate and easier to use in Excel. Perhaps we should ensure the numbers are rounded, though?

bartezz’s picture

Hey longwave,

Thanx for the fast reply. I do think rounded numbers would be better indeed.

Also a problem that arrises now that the currency symbol has been dropped is that opening the .csv in Excel causes drama... Excel tries to interpret the numbers, adds thousands and decimal marks, etc. This was prevented before because of the currency symbol. Ofcourse this is an Excel problem and one should take great care when opening the csv in Excel.

But to make things more easy for users throughout the world would it be possible to set the decimal mark for csv exports somewhere? This would prevent much hassle to those who are less experienced :)

Cheers

longwave’s picture

Title: Update to 6.x-2.7 messed up CSV exports at admin/store/reports » CSV exports should use rounded numbers

Excel *should* be interpreting the numbers, and is why this was changed in the first place; you can use the Excel formatting features to remove or change these if you want.

bartezz’s picture

Hi longwave,

Yeah it should :) But I think because of the decimal mark differences between countries and this the Excel settings both my and my clients's Excel change this 9999.99485 to this 999.999.485
If I change the csv in notepad to 9999,99485 and then open in Excel it gets converted to 9.999,99485

Probably because Excel is setup to use a comma as a decimal mark. That's why I was asking if we could make it a setting.

Cheers

longwave’s picture

Title: CSV exports should use rounded numbers » CSV exports should use rounded, formatted numbers with no symbol

Well, we already have currency format settings, so we probably just want to use those without the symbol. Hopefully the title covers what needs to be done now :)

tr’s picture

Version: 6.x-2.7 » 6.x-2.x-dev
Component: Other » Reports
longwave’s picture

Status: Active » Closed (won't fix)

We would be better off converting reports to Views in #568854: Replace uc_reports with Views where users could export them in many different ways.