I’m struggling a bit with the play 2.0 templating system; I have a method that returns what in scala is an ‘Int’ and I want to format it using the pattern “#,###”.
I have tried @order.itemCount().format("#,###") and @( order.item.count() format "#,###" ) but no love.
I’m not sure if there’s a trick to this in the play template syntax or whether I just need to learn how to do this in Scala.
The most straightforward approach would be to use Java’s string formatting:
This will also handle localization correctly: