由网友(在思念里沉沦)分享简介:我需要这样格式化一个数字:I need to format a number like this:sprintf("%05d",$lineNumber)但我在 Symfony2 Twig 模板中.那我该怎么办?But I'm inside a Symfony2 Twig template. So what can...
我需要这样格式化一个数字:
I need to format a number like this:
sprintf("%05d",$lineNumber)
但我在 Symfony2 Twig 模板中.那我该怎么办?
But I'm inside a Symfony2 Twig template. So what can I do?
推荐答案
Twig 提供了很多 过滤器,看看 format
和 number_format
.
Twig provides lots of filters, take a look at format
and number_format
.
相关推荐
最新文章