jquery - j模板货币保留 2 位小数

标签 jquery jtemplate

我需要在 jTemplate 中显示货币。

{parseInt($T.product.Details[0].Price).toFixed(2)} 显示为 34.50,但 i 应该显示为带有逗号,如 34,50。

我尝试了几个函数来用逗号替换点,但到目前为止还没有成功。谁能指出我正确的方向?

标记

最佳答案

{parseInt($T.product.Details[0].Price).toFixed(2).replace('.',',')}

关于jquery - j模板货币保留 2 位小数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2270043/

相关文章:

javascript - 基本 jTemplate 不起作用

javascript - 在表上保存隐藏数据的正确方法是什么?

jquery - HTML 表单选择第 n 个元素

javascript - css元素后面的背景图片

jquery - 菜单 <li> 悬停显示带有过渡的 div

jQuery 数据表 : how to sort by specific column?

javascript - ajax API 数据在控制台中输出,但不会附加到 HTML

jquery - j模板 : html in variables

jquery - 将 jTemplate 与 ASP.NET MVC 结合使用

jquery - JTemplates序列化