Hello everybody.
I have read several posts regarding number format of reports, but have not found a clear solution yet.
The report_sales_total.tpl is generated with help of report_sales_total.xml and report_sales_total.php. I can't figure out how to change the numbering format. I want to change it to decimal character ',' and the thousand separator to '.'
Changing the format with number_format() is not possible in my opinion, because the value in the XML file is not a php variable, but is generated with a XML parser (I think).
Can anyone help me with this? What can I do to change the number format for such reports (there are more reports which I want to change)
Thanks in advance!
gr,
DB
Change report_sales_total.php by changing the line with the 'select' statement in it.
change from
$sSQL = "select sum(ii.total) as total
change to
$sSQL = "select concat('$',Format(sum(ii.total),2)) as total
This isn't using the locales with SI, and so is a quick and dirty fix only.
Thanks. This has been on my todo list for a while. Now I'll try and do it system wide using locales.
Matt
Hi Matt,
Thanks. It is not directly the solution I requested, but you led me to the right solution.
I wanted a different number format (such as €5.000,89).
I have now used the replace() function of mysql to replace the dots and the commas. (It's quick and dirty, I know)
Thanks for your help!
DB
It looks like you're new here. If you want to get involved, click one of these buttons!