如何在Play 2.0模板中格式化数字/日期? [英] how to format a number/date in play 2.0 template?
本文介绍了如何在Play 2.0模板中格式化数字/日期?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在play 2.0模板系统上有点挣扎;我有一个方法可以返回scala中的"Int",我想使用模式#,###"对其进行格式化.
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 "#,###".
我尝试过@order.itemCount().format("#,###")
和@( order.item.count() format "#,###" )
,但是没有爱.
I have tried @order.itemCount().format("#,###")
and @( order.item.count() format "#,###" )
but no love.
我不确定播放模板语法中是否有此技巧,或者我是否只需要学习如何在Scala中做到这一点.
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.
推荐答案
查看全文