emfpc
3 months ago

Laravel Exporting to Excel Number Field

Posted 3 months ago by emfpc

Greetings. Currently i'm working with a export plug in where i must export data to excel everything works on my end but were i need the field to display example Credit Card Number of 16 character it round it. i have tried to format the column but it won't work in some cases. Is there a way a can bypass the format?

The Export Code: ' public function columnFormats(): array { return [ 'X' => NumberFormat::FORMAT_NUMBER, 'P' => NumberFormat::FORMAT_CURRENCY_USD, ]; }

public function view(): View{
    $guests=Guest::all();
    return view('form.export',compact('guests'));
}

'

The P column works which add the $ sign

Please sign in or create an account to participate in this conversation.