How to convert to number in PHP Spread Sheet

101 views Asked by At

I have a PHP Spreadsheet code as follows

$cellAddress = 'Q' . $i_s1;
    $cell = $sheet->getCell($cellAddress);
    $style = $cell->getStyle();
    $style->getNumberFormat()->setFormatCode('_(* #.##0,00_);_(* (#.##0,00);_(* "-"??_);_(@_)');
    
    if($resolve_1_s1 == "" && $closed_1_s1 == ""){
        $sheet->setCellValue('Q'.$i_s1, "0");
    } else {
        $totalDuration_s1 = calculateDuration($inistatus_s1, $created_1_s1, $resolve_1_s1, $closed_1_s1, $tahun_mulai, $tahun_selesai);
        $hasilAkhir_s1 = number_format($totalDuration_s1, 2, ',', '.');
        $sheet->setCellValue('Q'.$i_s1, $hasilAkhir_s1);
    }

but when I open the file, it appears as follows

enter image description here

I want the warning to disappear (make it as Convert to Number)

enter image description here

0

There are 0 answers