money() format on Infolist
How to remove trailling .00 from money() format on Infolist?
Infolists\Components\TextEntry::make('price')
->label('Price')
->translateLabel()
->money(config('settings.currency'))
->color('secondary'),
So I would like 250.00 to show as 250, but 250.12 should keep decimals.2 Replies
Not sure, but did you try numeric? https://filamentphp.com/docs/3.x/infolists/entries/text/#number-formatting
You could also use formatStateUsing
https://filamentphp.com/docs/3.x/infolists/entries/text/#custom-formatting
Thanks, I tried, but if I use numeric, the money format is overwritten so it shows without currency. I know I can use formatStateUsing, but I thought might be some more elegant default variant so I avoid using it on each money display. But is probably only option.