我认为这是一个相当愚蠢的问题,我研究了格式化数字以转换为价格格式的方法。我正在使用 smarty 作为模板系统。是否可以通过 smarty 或某种可用于此目的的方法来格式化价格?
我需要将类型数字 1000000 转换为 $1.000.000
smarty没有输出格式,还有什么办法?
谢谢
最佳答案
使用 PHP 的 money format function
在 smarty 中会是 {$myNumber|money_format:'%i'}
关于php - Smarty 上的价格数字格式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17710707/