Issue with Summary Range formatting

 ->formatStateUsing(function ($state) {
  return $state / 100;
})

wont work because Unsupported operand types: array / int
dd state:
array:2 [▼ // ...
  0 => 100
  1 => 400
]


ok, so I do
->formatStateUsing(function ($state) {
  return  $state[0] / 100 . ' - ' . $state[1] / 100;
})

it just shows 1 and nothing else

how do I format this then? (want 1-4)
image.png
Solution
you need to return an array with each number
Was this page helpful?