shuchkin/simplexlsxgen, how to prevent Decimal dott from changing to comma

120

Question: shuchkin/simplexlsxgen, how to prevent Decimal dott from changing to comma

i am using (shuchkin/simplexlsxgen) to generate xlsx file which works fine. My data contain decimal numbers such as (0.19) which are written in the SQL DB, but instead writting them with dott, the (simplexlsxgen) convert them to (0,19) php error comma decimal numbers. is there a way to prevent changing the decimal Dott to comma, before generating? Thanks in advance.

//convert test_bulk.csv to Xlsx function csvToArray($csvFile) {     $file_to_read = fopen($csvFile, 'r');    while (!feof($file_to_read))    {        $lines[] = fgetcsv($file_to_read, 1000, ';');    }    fclose($file_to_read);    return $lines; } //read the csv file into an array $csvFile = 'test_bulk.csv'; $csv = csvToArray($csvFile); Shuchkin\SimpleXLSXGen::fromArray($csv)->saveAs('final_bulk.xlsx'); 

Total Answers: 1

76

Answers 1: of shuchkin/simplexlsxgen, how to prevent Decimal dott from changing to comma

by adding "\0". before the targeted string, it will turn it to be a RAW STRING. which will make this super Tool write it without changing the decimal dott to comma. you all gotta try this amazing fast effective tool by the PHP Excel Old school Master (Sergey Shuchkin). https://github.com/shuchkin