Format number in stats widget?

I'm doing this and it works, but I want to format the value as currency. Any idea how I'd do that?
class ReportsOverview extends BaseWidget
{
protected static ?string $pollingInterval = null;

protected function getStats(): array
{
return [
Stat::make('Total', CustomerDepositsReport::sum('amount_paid'));
];
}
class ReportsOverview extends BaseWidget
{
protected static ?string $pollingInterval = null;

protected function getStats(): array
{
return [
Stat::make('Total', CustomerDepositsReport::sum('amount_paid'));
];
}
Solution:
Try with number_format() around the value
Jump to solution
2 Replies
Solution
Thijmen
Thijmen9mo ago
Try with number_format() around the value
Jon Mason
Jon Mason9mo ago
yep that worked. Duh. I don't know why I just expect that there's some easy filament-y way to do things that are already easy to begin with. 🙄