Since some months I have detected the power in Twig when handling numbers in Views UI.
Sorry to say, I also have detected a serious problem with this wonderful tool in Views.
Twigs number format functions seem not to be working in Views when using grouping function.
EX:
Text Price
Bread 23,60
Milk 15,30
Sum 38,90
Using {{field_price__value| round}} works for Bread and Milk. It results in 24 and 15.
Using the sane for The grouped Sum it results in 0
Using {{field_price| round}} it results in 1
Comments
Comment #2
chrotto commentedThink I found an answer on this.
The Twig format did function if I set the thousand markers to none in Views UI.
Comment #4
dimaboychev commentedHad the same issue. In my case there is no "thousand markers to none in Views UI" option.
to solve the problem I did the following (first set the value to a variable and use 'trim', then do anything you want with that variable):
Comment #5
codesmithYou can do it all on one line
Comment #14
luke.stewart commentedGiven the solution here seems to be correctly formatting the output, and there has been no engagement for 7 years since multiple solutions have been offered.
I'm going to mark this as closed works as designed.
If you disagree feel free to reopen.