From 785f023476b7370136f4fbce42f3b9ab9f4079db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Wr=C3=B3blewski?= Date: Sat, 5 Oct 2024 17:27:27 +0200 Subject: [PATCH] Update formatter option docs --- docs/src/reference/types/column/options/column.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/src/reference/types/column/options/column.md b/docs/src/reference/types/column/options/column.md index 8e0f56c5..39a26b7b 100644 --- a/docs/src/reference/types/column/options/column.md +++ b/docs/src/reference/types/column/options/column.md @@ -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(); + }, ]) ; ```