Skip to content

Commit

Permalink
Update formatter option docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Kreyu committed Oct 5, 2024
1 parent 5972c72 commit 785f023
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion docs/src/reference/types/column/options/column.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,9 @@ Formats the value to the desired string.
```php
$builder
->addColumn('quantity', NumberColumnType::class, [
'formatter' => fn (float $value) => number_format($value, 2) . 'kg',
'formatter' => function (float $value, Product $product, ColumnInterface $column, array $options) {
return number_format($value, 2) . $product->getUnit();
},
])
;
```
Expand Down

0 comments on commit 785f023

Please sign in to comment.