I read in this tutorial : https://laravel-excel.maatwebsite.nl/3.0/exports/column-formatting.html
My script export like this :
namespace App\Exports;
...
use PhpOffice\PhpSpreadsheet\Style\NumberFormat;
use Maatwebsite\Excel\Concerns\WithColumnFormatting;
class SummaryExport implements WithColumnFormatting
{
...
public function columnFormats(): array
{
return [
'H' => NumberFormat::FORMAT_NUMBER_COMMA_SEPARATED2
}
}
For example the real value = 30132,7531
If I use the format in my script above, it will to be : 30.132,75
It doesn't match the format I want
I want the format like this : 30.133
I try custom the format in the PhpOffice\PhpSpreadsheet\Style\NumberFormat;
I add this :
const FORMAT_NUMBER_CUSTOM = '#,##0';
And I add the const to my script above, it works, the result 30.133
I want to ask whether this is the right way? And can I edit the number format inside the vendor folder?
This PhpOffice\PhpSpreadsheet\Style\NumberFormat;
located in vendor folder