Open Aligan opened 8 years ago
This is not an issue with PHPExcel, this is called ROUNDING
Help me! round() not working
What do you mean "round() not working"? round()
is a standard PHP function, that works pretty effectively:
$price = 544.8099999999999;
echo round($price, 2);
Alternatively, if you have formatting for your cells, then use:
$price = $objPHPExcel->getActiveSheet()->getCellByColumnAndRow(4, $i)->getFormattedValue();
As described in the PHPExcel Documentation
The file is 544.81 price, and online 544.8099999999999 I getting value for money:
$price = $objPHPExcel->getActiveSheet()->getCellByColumnAndRow(4, $i)->getValue();