I am using cakephp 3.2 csv plugin ,here i got everything what i supposed to need , but i want to make some modifications like want to add price format in the price showing in csv file(0.00).
As it is directly coming from the db ,i am not getting any way to make it. Please suggest me .Any suggestion will be highly appreciated .
Below is the screen short and some code .
$data = $this->Orders->find('all')->where($condition)->contain(['Collections', 'Customers' => ['queryBuilder' => function ($q) {
return $q->select(['id', 'center_name']);
}],])->order(['Orders.due_date ASC']);
//$data = $this->Orders->find('all')->toArray();
// pj($data);exit;
$_serialize = 'data';
$_delimiter = ','; //tab
$_enclosure = '"';
$_newline = '\n';
$_eol = '~';
$_bom = false;
$_header = ['Invoice Date', 'Invoice', 'Center Name', 'Total', 'Paid', 'Due', 'Due Date'];
$_extract = ['billing_date', 'invoice_no', 'customer.center_name', 'net_total', 'amount.paid', 'amount.due', 'due_date'];
$this->set(compact('data', '_serialize', '_header', '_extract', '_delimiter'));
$this->viewBuilder()->className('CsvView.Csv');
return;
Here all the price section should be come like this 110.00 , 40.00 and 70.00 and so on.
Thank you .