Currency factoring 100 (Solved)
I am trying to use filamente admin v3 but I am facing a problem. I keep all my fields related to currency with a factor of 100, so as not to use decimals but whole numbers.
Try using -> Tables\Columns\TextColumn::make('price', 100)->money('eur'), but that divides by 100 but rounds to 100 decimal places.
Any idea how to do it?
5 Replies
Solution
do it in the model attribute then everywhere will be consistent
Can you explain, pelase?
it's a basic laravel feature https://laravel.com/docs/10.x/eloquent-mutators#accessors-and-mutators
Laravel - The PHP Framework For Web Artisans
Laravel is a PHP web application framework with expressive, elegant syntax. We’ve already laid the foundation — freeing you to create without sweating the small things.
Ah.. yes. But I like it in Filament usning reactivity or hidratation. Thanks.