PHP和excel导出

I have problem of decimal places in excel 2013. The amount less than thousand it does not show the decimal otherwise show decimal in Excel cell. Amount with thousand show (1233.00) and if amount less than thousand then show (763).

$datatable = "<table><tr>";
while($nt=mysql_fetch_array($finalquery)) {
        $amount= number_format($nt[3],2);
        $datatable .= "<td>$amount</td>";
}
$datatable = "</tr></table>";
$dtimestamp= time( );
$ddatetime = date("G-i-s",$dtimestamp);     
$filename = "External_data_" . date('dmY') .":". $ddatetime .".xls"; 
header('Content-type: application/ms-excel');
header("Content-Disposition: attachment; filename=\"" . $filename . "\"");
echo $datatable;

<?php //in moodle    
    mysql_connect($CFG->dbhost,$CFG->dbuser,$CFG->dbpass);
    mysql_select_db($CFG->dbname);
        
      $sql ="SELECT *
FROM dddd c WHERE a.deleted = 0 AND mi.is_deleted='0' AND a.id!='2' and a.regtype!='trial' AND  ra.roleid=5     GROUP BY userid";

     

    //$filename = $fname.".csv";    
   
    mysql_query("SET NAMES 'utf8'");
    $rsSearchResults = mysql_query($sql) or die(mysql_error()); 
    
 
     
$xlsarr = array();
$xlshead = array();
 $xls_lastcolumn='O';
    $xl_aplha=createColumnsArray($xls_lastcolumn);  
     
    $nums=0;
     
    for($i=0; $i<mysql_num_fields($rsSearchResults);$i++){
      $column_name=mysql_fetch_field($rsSearchResults, $i);
      $xlshead[$xl_aplha[$nums]]=$column_name->name;
     $nums=$nums+1;
    }  
      
      //   $my_xlshead_add=array('15'=>'Registration Code');
        // $_xlshead=array_merge($xlshead,$my_xlshead_add);
            
       $xlsarr[] = $xlshead;
    
 //$csvid=0;
    while ($l = mysql_fetch_assoc($rsSearchResults)) {
        
        $numk=0;
  
        $l['Password']='';
        if($l['Activation Date']=='1970-01-01')
        {
            $actdate='';
        }
        else
        {
            $actdate=date("Y/n/j",strtotime($l['Activation Date']));
        }
        $l['Activation Date'] = $actdate;
        if($l['Expiration Date']=='1970-01-01')
        {
            $expdate='';
        }
        else
        {
            $expdate=date("Y/n/j",strtotime($l['Expiration Date']));
        }
        $l['Expiration Date'] = $expdate;
        
        
        
         $reg_code=get_regcode($l['userid']);
        // $my_array_add=array('15'=>$reg_code,'Registration Code'=>$reg_code);
        // $_array_merge=array_merge($l,$my_array_add);
        
        // unset($l['userid']);
        // Dependent on select query
         $xlsdata[$xl_aplha[$numk]]=$l['Coloumn4'];
         $xlsdata[$xl_aplha[$numk=$numk+1]]=$l['Coloumn45'];
         $xlsdata[$xl_aplha[$numk=$numk+1]]=$l['Coloumn4Name'];
         $xlsdata[$xl_aplha[$numk=$numk+1]]=$l['Coloumn443'];
         $xlsdata[$xl_aplha[$numk=$numk+1]]=$l['Coloumn4'];
         $xlsdata[$xl_aplha[$numk=$numk+1]]=$l['Coloumn4Name'];
         $xlsdata[$xl_aplha[$numk=$numk+1]]=$l['Coloumn5Address'];
         $xlsdata[$xl_aplha[$numk=$numk+1]]=$l['Coloumn6Number'];
         $xlsdata[$xl_aplha[$numk=$numk+1]]=$l['Coloumn7'];
         $xlsdata[$xl_aplha[$numk=$numk+1]]=$l['Coloumn8'];
         $xlsdata[$xl_aplha[$numk=$numk+1]]=$l['Coloumn9'];
         $xlsdata[$xl_aplha[$numk=$numk+1]]=$l['Coloumn10Code'];
     
         
         
        
         $xlsarr[]=$xlsdata;  
    //   $csvid++;
         
     
   
    }
 
//  pr($xlsarr);
      $fname = "Elsevier_Users"; 
         
            //printExcel2($csvarr,"xls",$fname,false);
            $myfilename=$fname.'.xls';
            myprintExcel($xlsarr,$xls_lastcolumn,$myfilename);
        
               
?>///for excel import and export
function myprintExcel($xlsarr,$LastColumn,$filesname){
  //  global $CFG;
//  require_once($CFG->libdir.'/phpmailer/class.phpmailer.php');
   
    global $filePath;
    ob_start();
    include ($filePath.'/PHPExcel/Classes/PHPExcel.php');
     
 
    $objPHPExcel = new PHPExcel();
    
$objPHPExcel->getProperties()->setCreator("XLSX")
                             ->setLastModifiedBy("XLSX")
                             ->setTitle("XLSX")
                             ->setSubject("XLSX")
                             ->setDescription("XLSX")
                             ->setKeywords("XLSX")
                             ->setCategory("ElsevierUsers");

// Add some data
$val=0;
//echo '<pre>';
//print_r($xlsarr);
//die();
foreach ($xlsarr as $arykey=>$aryLine)
      {
    
  $rowInd = $arykey+1;
  
      
     
      $lastcol=createColumnsArray($LastColumn);
      
        foreach ($lastcol as $key=>$char) {
             
      //   echo $aryLine[$i_count].$char.$arykey . "
";
      
      $objPHPExcel->setActiveSheetIndex(0)->setCellValue($char.$rowInd, $aryLine[$char]);
      }
 
$val++;           
      } 
       
$objPHPExcel->getActiveSheet()->setTitle('ElsevierUsers');


// Set active sheet index to the first sheet, so Excel opens this as the first sheet
$objPHPExcel->setActiveSheetIndex(0);

// Query Database

// Redirect output to a client’s web browser (Excel5)
header('Content-Type: application/vnd.ms-excel');
header('Content-Disposition: attachment;filename="'.$filesname.'"');
header('Cache-Control: max-age=0');

$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');
$objWriter->save('php://output');
exit;
   
 }

</div>