我正在使用 matwebsite 匯出 excel 檔案,我正在從它存盤在匯出的 excel 檔案中的資料庫中獲取資料,直到這部分它作業正常。當時某些值超過 15 位,它顯示為scientifc 我的格式使用columnFormats()函式進行了一些更改,現在它最多支持 16 位數字,如果有任何超過 16 位數字的值,它會將最后一位數字替換為zero's,如何糾正此錯誤,請幫助我解決此問題..
``
public function columnFormats(): array
{
return [
'D' => '#0',
];
}
**my downloaded excel**
1234567890123456 //16 digits it's working fine
12345678901234567000 //actual value is 1234567890123456789
uj5u.com熱心網友回復:
Columnformats 函式告訴 excel 轉換為 Excel 中的數字行為,該數字最多支持 16 位數字,因此此更改不適用于您的情況。
如果您想實作您的方案,請使用以下參考bindValue()函式并將資料型別更改為string(Excel 中的字串支持更多字符)。
https://docs.laravel-excel.com/3.1/imports/custom-formatting-values.html
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/398076.html
