tags:

views:

61

answers:

1

This my example code:

$objPHPExcel->setActiveSheetIndex(0); $objPHPExcel->getActiveSheet()->SetCellValue('A2', '1.0'); $objPHPExcel->getActiveSheet()->SetCellValue('B2', '0.0'); $objPHPExcel->getActiveSheet()->SetCellValue('C2', '1.2'); $objPHPExcel->getActiveSheet()->SetCellValue('D2', '100');

Iam getting in excel sheet is round off values for A2->1 and B2->0 , What im need to output in excel sheet is A2->1.0 and B2->0.0. I need the float values end with .zero(.0) to print Please help me out...

+1  A: 

You need to set the display format of the cells to Number. The default in Excel is General, which will display the values as you describe. I don't know if the PHP Excel interface will let you set the cell format, but that's where you should start.

EDIT: According to the PHPExcel website it supports setting cell formats. Read the docs to find out how to set the appropriate format.

Jim Garrison